資源描述:
《python data analysis pandas primer》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、pandasPrimerpandasisnamedafterpaneldata(aneconometricterm)andPythondataanalysis,andisapopularopensourcePythonproject.Thischapterisatutorialonbasicpandasfunctionalities,wherewewilllearnaboutpandasdatastructuresandoperations.Theofficialpandasdocumentationinsistsonnamingtheprojectpandasinalllowerca
2、seletters.Theotherconventiontheyinsistonisthisimportstatement:importpandasaspd.Wewilltrytofollowtheseconventionsasmuchaspossible.Inthischapter,wewillinstallandexplorepandas.Then,wewillacquaintourselveswiththetwocentralpandasdatastructures:DataFrameandSeries.Afterthis,youwilllearnhowtoperformSQL-
3、likeoperationsonthedatacontainedinthesedatastructures.pandashasstatisticalutilitiesincludingtime-seriesroutines,someofwhichwillbedemonstrated.Thetopicswewillpursueareasfollows:?Installingandexploringpandas?DataFrameandSeriesdatastructures?Queryingdatainpandas?StatisticswithpandasDataFrames?Dataa
4、ggregationwithpandasDataFrames?Concatenating,joining,andappendingDataFrames?Handlingmissingvalues?Dealingwithdates?Pivottables?RemotedataaccesspandasPrimerInstallingandexploringpandasTheminimaldependencysetrequirementsforpandasisgivenasfollows:?NumPy:Thisisthefundamentalnumericalarraypackagethat
5、weinstalledandcoveredextensivelyintheprecedingchapters?python-dateutil:Thisisadate-handlinglibrary?pytz:ThishandlestimezonedefinitionsThislististhebareminimum;alongerlistofoptionaldependenciescanbelocatedathttp://pandas.pydata.org/pandas-docs/stable/install.html.WecaninstallpandasviaPyPIwithpipo
6、reasy_install,usingabinaryinstaller,withtheaidofouroperatingsystempackagemanager,orfromthesourcebycheckingoutthecode.Thebinaryinstallerscanbedownloadedfromhttp://pandas.pydata.org/getpandas.html.Thecommandtoinstallpandaswithpipisasfollows:$pipinstallpandasYoumayhavetoprependtheprecedingcommandwi
7、thsudoifyouruseraccountdoesn'thavesufficientrights.Formost,ifnotall,Linuxdistributions,thepandaspackagenameispython-pandas.Pleaserefertothemanualpagesofyourpackagemanagerforthecorrectcommandtoinstall.Thesecommandsshouldbethe