資源描述:
《python data analysis data visualization》由會員上傳分享,免費在線閱讀,更多相關內容在工程資料-天天文庫。
1、DataVisualizationOneofthefirststepsindataanalysisisvisualization.Evenwhenlookingatatableofvalues,wecanformamentalimageofwhatthedatamightlooklikewhengraphed.Datavisualizationcallsfortheconceptionandanalysisofthevisualrepresentationofinformation,signifyingdatathathasbeenabstractedinsomeformal
2、pattern,includingpropertiesorquantitiesforunitsofmeasurementsofthedata.Datavisualizationistightlyassociatedwithscientificvisualizationandstatisticalgraphics.ThePythonmatplotlib(alllowercase)libraryisawell-knownplottinglibrarybasedonNumPy,whichwewillbeusinginthischapter.Ithasanobject-oriente
3、dandaproceduralMATLAB-likeAPI,whichcanbeusedinparallel.Agallerywithmatplotlibexamplescanbefoundathttp://matplotlib.org/gallery.html.Thefollowingisalistoftopicsthatwillbecoveredinthischapter:?Basicmatplotlibplots?Logarithmicplots?Scatterplots?Legendsandannotations?Three-dimensionalplots?Plot
4、tinginpandas?Lagplots?Autocorrelationplots?Plot.lyDataVisualizationmatplotlibsubpackagesIfwepickupourpkg_check.pyfileprovidedinthecodebundleandchangethecodetolistthematplotlibsubpackages,wegetthefollowingresult:matplotlibversion1.3.1matplotlib.axesmatplotlib.backendsmatplotlib.compatmatplot
5、lib.delaunayDESCRIPTION:Author:RobertKern:Copyright:Copyright2005RobertKern.:License:BSD-stylelicense.SeeLICENSE.txmatplotlib.projectionsmatplotlib.sphinxextmatplotlib.stylematplotlib.testingmatplotlib.testsmatplotlib.triThesubpackagenamesareprettyself-explanatory.Bac
6、kendsreferstothewaytheendresultisoutput.Thiscanbeoneofseveralfileformatsoronthescreeninagraphicaluserinterface.Forcompleteness,refertothefollowingsnippetwiththechangedlinesinpkg_check.py:importmatplotlibasmplprint"matplotlibversion",mpl.__version__print_desc("matplotlib",mpl.__path__)Basicm
7、atplotlibplotsWeinstalledmatplotlibandIPythoninChapter1,GettingStartedwithPythonLibraries.Pleasegobacktothatchapterifyouneedto.TheproceduralMATLAB-likematplotlibAPIisconsideredbymanyassimplertousethantheobject-orientedAPI,sowewilldemonstratethisprocedura