-
-
0# độc thủ sổ cư data = pd.read_csv('data\population.csv', index_col ='Year') data1 = data[['Boys','Girls']] mean = np.mean(data1,axis=0) # kế toán quân trị std= np.std(data1,axis=0)# kế toán tiêu chuẩn soa #Sang kiến đồ fig = plt.figure(figsize = (6,2)) # thiết trí đồ phiến đại tiểu plt.subplots_adjust(wspace = 0.6) # thiết trí lưỡng cá đồ chi gian đích túng hướng gian cách # hội chế quân trị đích thùy trực hòa thủy bình trụ trạng đồ, tiêu chuẩn soa sử dụng ngộ soa tuyến lai biểu kỳ ax1 = fig.add_subplot(1, 2, 1) mean.plot(kind='bar',yerr=std,color='cadetblue',title = 'Average of Births',rot=45) ax2 = fig.add_subplot(1
-
0Thiết phân vi huấn luyện tập hòa trắc thí tập from sklearn import model_selection X_train, X_test, y_train, y_test = model_selection.train_test_split(X, y, test_size=0.35, random_state=1) tại huấn luyện tập thượng học tập hồi quy mô hình linregTr= LinearRegression() linregTr.fit(X_train, y_train) print (linregTr.intercept_, linregTr.coef_) tại trắc thí tập thượng bình cổ tính năng from sklearn import metrics y_test_pred = linregTr.predict(X_test) test_err = metrics.mean_squared_error(y_test, y_test_pred) print( 'The mean squar error of test are: {:.2f}'.format(test_err) ) predict_score =linregTr.score(X_test,y_test) print('Th
-
0Độc thủ sổ cư importpandas as pd filename= 'C:/pdata/week11/advertising.csv' data= pd.read_csv(filename,index_col= 0) data[0:5] # đạo nhập hội đồ khố import matplotlib.pyplot as plt data.plot(kind='scatter',x='TV',y='Sales',title='Sales with Advertising on TV') plt.xlabel( "TV" ) plt.ylabel( "sales" ), hoạch thủ X hòa y X = data.iloc[:,0:3].values y = data.iloc[:,3].values 4 ) kiến lập 3 cá tự biến lượng dữ mục tiêu biến lượng đích tuyến tính hồi quy mô hình, kế toán ngộ soa. # tòng sklearn khố lí diện đích linear_model tử khố lí đạo nhập LinearRegression hàm sổ from sklearn.linear_model i
-
0# tương sổ cư án nam sinh hòa nữ sinh phân tổ data1= stdata[stdata['Gender'] == 'male'] # si tuyển xuất nam sinh data2= stdata[stdata['Gender'] == 'female']# si tuyển xuất nữ sinh #Phân tổ hội chế nam sinh, nữ sinh đích tán điểm đồ plt.figure() plt.scatter(data1['Height'],data1['Weight'],c='r',marker='s',label='Male') plt.scatter(data2['Height'],data2['Weight'],c='b',marker='^',label='Female') plt.xlim(150,200)#x trục phạm vi plt.ylim(40,80) #y trục phạm vi plt.title('Students Body Shape') # tiêu đề plt.xlabel('Weig
-
0import matplotlib.pyplot as plt# đạo nhập hội đồ khố plt.figure() #Sang kiến hội đồ đối tượng GDPdata=[[41.3,48.9,54.0,59.5,64.4,68.9,74.4] # chuẩn bị hội đồ đích tự liệt sổ cư plt.plot(GDPdata,color= "red",linewidth=2,linestyle='dashed',marker='o',label='GDP') # hội đồ # tinh tế thiết trí đồ nguyên plt.title('2010~2016GDP: Trillion') plt.xlim(0,6) #x trục hội đồ phạm vi plt.ylim(35,75) #y trục hội đồ phạm vi plt.xticks(range(0,7),('2010','2011','2012','2013','2014','2015','2016'))# tương x trục khắc độ ánh xạ vi tự phù xuyến plt.legend(loc='upper
-
0import pandas as pd import numpy as np độc thủ sổ cư data = pd.read_csv('StudentsPerformance.csv') data.head() kiểm tác không bạch data.isnull().any() điền sung data.fillna(method='ffill',inplace=True) data.isnull().any() bình quân phân data['mean_scores'] = (data[ "math score" ] + data[ "reading score" ] + data[ "writing score" ]) / 3 data.head() thâu xuất bình quân phân đại vu 80 mask = data['mean_scores']>80 filter = data.loc[mask] filter.to_csv('data80.csv',mode='w',header=True,index=False) tiền thập data.sort_values(by='mean_scores',asc
-
0
-
69
- Phát thiếp hồng sắc tiêu đề
- Hiển kỳ hồng danh
- Thiêm đáo lục bội kinh nghiệm
Tặng tống bổ thiêm tạp 1 trương, hoạch đắc[ kinh nghiệm thư cấu mãi quyền ]
Tảo nhị duy mã hạ tái thiếp ba khách hộ đoan
Hạ tái thiếp ba APP
Khán cao thanh trực bá, thị tần!
Khán cao thanh trực bá, thị tần!