Python数据挖掘环境搭建.docx
《Python数据挖掘环境搭建.docx》由会员分享,可在线阅读,更多相关《Python数据挖掘环境搭建.docx(27页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、4 X,实验报告学号20191106078姓名龚永好上机地点信-506专业电子信息工程班级电信1902班时间2022年5月5日上机内容实验一:Python数据挖掘环境搭建一、实验目的及要求目的:学会安装Python软件,学会安装第三方扩展库,建立开发环境,学会使用Python数据分析 工具。要求:1 .完成Python及numpy、pandas scipy matplotlib等第三方库的安装,画出安装流程图并备 注考前须知。2 .完成数据集中趋势统计,计算均值、中位数和众数。3 .完成数据离散趋势统计,计算极差、四分位数、四分位距、五数概括、方差和标准差、DataFrame描述性统计,画出画
2、箱线图。4 .完成数据基本统计图,画出条形图、饼状图、折线图、直方图、散点图、分位数-分位数图。二、实验设备(环境)及要求1 .硬件要求:CPU在2.0 GHz以上,内存在4G以上,建议8G。2 .软件要求:Widows7系统及以上系统,Anaconda编译环境。三、实验内容(-)Python安装及第三方库的安装与检查数据挖掘理论与实践指导教师:向前 SNr (Python 36 .D & E is A 国目-TG MU 餐津 B X Z 1-10 9Ti-isG”日1#coding: utf-831-1656 QI7print(Ql)|np.percentile(feature_l,0.25
3、)Vari able splrr | File vfl0rwr MlpIKythe catleB CosI l/*O Ia H: runfle( *C: /Users/AdiUnlstrAtor/Oesktap/shujiMjue-shlyanl/1-14(C:/lHer$ AdBiniitratcr/DesktcoZ2.3四分位数极差(四分位距)Re dit Search Source gun Qebug Consoles grpjecH loots yiew Help口g sktotshQjwtjMvskiyuil 个Eixtdr - C WsrsVA4Miii str*trB4sktoV
4、shnjustjua-shiytQl U*17. pyX Klp& XCl I 1-10.”; I l-U y I 172” I 1-13.0 | J-14.py1 -1$ yy 1;6 - l-T py O | L Swec-1; Obj“, G Ct1# - *- coding: utf-8 - 4- 2 31-17 4 5 6IQR = Q3 - QI 7print(IQR) 8|UsageHere you can get help of f object by Ctrl*! n frort of . eeber cn the (deo or theQxw*rlelpcan dso be
5、 shewn autcnidtica*V after rrittnr or c Q/e允,ences Ne toSpder,*ad oistrtor/Oesktop/shujut- shjyani/1 14.py* wtlr*C :/UMrs/Adainistrtor/Oefktop/ shujvwAjue-shiyenl)j.eeeoeeeeoeeeeeesIn 32: runf ile( C:,: c .,-!. t.p/tnuju ajue-ihXyonl . . t. p . wdlr* C:AdedX atL/Dedushu juwa jue- Piy*l *)Xn 33: runf
6、lle( C: J-e , Ao*ldstr tor/Cc.- top/sjju.jjue- thiyanl/1 1- .py wdlr C: Zl ie* . *uin. il,t it_ Oct,xtop, $hujuojuc $HyMl ,)4.33725in ij: runriie( i: shujuwajue*shiynl),皿l”.pb , wdir-a. -dn . 115trtor/Desktop/Xn SS:2.4五数概括3e dit Search Source gun Qebug Cfifnolei grojecH look Jfiew Help口注由海 A昌日师6 MC餐
7、同X/一 C: VsrsJL4BimstrUorBskto*duijwtjMvxkiyud 个Editor - C strsVAdioistrftiorDsktodmjuBtju*xhiyatU-18. py二;1-u” 卜 12.”1-13 ” I 1-14 rr 1-15.py ,1-16.” 1-H py E P,1# - - coding: utf-8 - -2 ” ” “31-18456 max_value = np.max(feature_l)7 Q3 = np.percentile(feature_l,75)8median-value np.median(feature_l)9
8、QI = np.percentile(feature_l,e.25)10 min_value = np.min(feature_l)11 min_value, QI, median_value, Q3, max_value12 print(min-value, QI, median_value, Q3, max_value)S x 1falpS x,卜 ,Ssurct Cvl* * 0bjc,G QVrible explorer File explorer MUpIFytUft CMisol*& XH EZ lO |14 QXn 32: runfileCC:/User$/A4Binistrto
9、*/Dcsktop/shuJimjue-shiyani/1 -15.pya, wdlr*C: /IMrs/AMnistrator/oeslctop/.$hujuMjue*shlyRl*) 4.4Xn 33: runfileOesktop/shujuwa. .py, wdir- -ator/Desktop/shujuwajue-shlyanl() 4.55725In M: runfile(C: Users/Adwinistotor/Desktop/shujuwajue-shiyanl 1-17.py,t wdir C:/tiers Administrato*/Desktop/ shujuwaju
10、e- sMyl) e.0627seeeeeee0ee)In 35: runfile( c : /Users/AdBinistrator/Desktop/shujuNijut-shiyanl/l-lS.py*, wrfirC: /Vsrs/Ars Ad 6.4, 7.9)Xn (37:2.5箱线图单一箱线图 Spyd*r (Pythoc 3.6, 上pe ditSource gun Qebug Cgmoles projects Jook yiew fjdp口餐店 酷 G HI c: CH C= H B X Z今,餐小E4tlr C UriA4iiiilrlorDi)rtpUraj口 1 1-12
11、 ty | 1-13 ni 上M ”J-15 y j 1-16 n J-17 w 1-10 py _ 179 ” ft Sowe. Cxal. 0b”“1# - - coding: utf-8 - -23 1-19456 import matplotlib.pyplot as pit7 pit.boxplot(xsfeature_l)8plt.ylabel(values of + iris_data.feature_names0)UyMe tt you can fet hep of ny object bv prea&nc CtrM c frort of t. either on the td
12、(tor or the ConsolHelpcar, aso be shown azoma-h after wfn a pe*enthesisnewt to an object. *ou can acnvMe thabehwU 7plxXFyUben9 :Cj i/*Q ,In 41 J: rwflle(c: users/Adainistrtor/Desktop/shuMie-shiyxu/1-19.py*3 血2-Min”/Desktop/ thvjwwajve sMyE *)aoItomPi tmgm (cm)In (42):多个箱线图f3e dit $,arch Source gun Q
13、ebug Cfimoles grojecH lookydp0 fe a i= Aglgl 布 C HI C: CH CH B wx/一 )C: UsrsA4*ixustrttorSrsktc&hu)xDf tjM&hAyoxilEixtor - C VxrsA4KU strtlorDsktoshmju*ju*xhiyaat py(9 X )klpQ | 1-12. xr 1-13.”1-14. py 1-15 py 1-14 py 1-17. py J-18 py 1-19 py 1-20 py L_ * Q, Src C*nU , jtHr 1 9 - -t/f-82 , 31-20 4 5
14、 6 import matplotlib.pyplot as pit 7 pit.boxplot(xfeature_l)-8 plt.ylabel( values of iris_data.feature_nanes0)-9 pit.xlabel(iris_data.feature_names9) 10 plt.show() 11 from pandas import DataFrane12 iris df = DataFrane(iris_data.data, columns=iris_data.feature names) 13fig, axes plt.subplots(l,4)14 i
15、ri$_df.plot(kind-box, ax-axes, subplots-True, title-All feature boxplots) 15 axes0.set_ylabel(iris_df.columns0)16 axes1.set_ylabel(iris_df.columnslj) 17 axes2.set_ylabel(iris_df.columns2) 18axes3.set_ylabel(iris_df.columns3) 19 fig.subplots_adjust(wspace=l, hspace=l) 20fig.show() 21Here you can get
16、he Ip of an object by press” Ctrkl ri front of ft. e ther on tht W0f ortht 8n3Help an Mo beWter wrMr *SNewtoSpvder9 Aead our”1“ 八】 心r”)klpIfythoa CMd4ltC:Prcgra)atAfond3Hbsit-packaftMtplotHbfigurc.py:459: UsenUrtting: Mtplotlib is currently using a non-GUI *kend, so cannot show the figuretplotlib is
17、 cyrretly using a non-QUX Mcktnd, *All feature boxpiots2.6方差和标准差50lepal length (an)In 47:05B*A A_00 4 , itepal mdth (an) petal length (cm) peUi wWi (cm Spyder (Python 3 6,pe Edit Search Source gun Qebug Cgmoles rject$ look yiew fjdp区I: A国目蜂C用仁仁生 E x Z 今C VtrsXii!us?Ml C餐之E X Z pe d* $e*fch Source gu
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Python 数据 挖掘 环境 搭建
限制150内