资源描述:
《getting started with python libraries》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、GettingStartedwithPythonLibrariesLet'sgetstarted.Wecanfindamindmapdescribingsoftwarethatcanbeusedfordataanalysisathttp://www.xmind.net/m/WvfC/.Obviously,wecan'tinstallallofthissoftwareinthischapter.WewillinstallNumPy,SciPy,matplotlib,andIPythonondifferen
2、toperatingsystemsandhavealookatsomesimplecodethatusesNumPy.NumPyisafundamentalPythonlibrarythatprovidesnumericalarraysandfunctions.SciPyisascientificPythonlibrary,whichsupplementsandslightlyoverlapsNumPy.NumPyandSciPyhistoricallysharedtheircodebasebutwer
3、elaterseparated.matplotlibisaplottinglibrarybasedonNumPy.YoucanreadmoreaboutmatplotlibinChapter6,DataVisualization.IPythonprovidesanarchitectureforinteractivecomputing.ThemostnotablepartofthisprojectistheIPythonshell.WewillcovertheIPythonshelllaterinthis
4、chapter.Installationinstructionsfortheothersoftwareweneedwillbegiventhroughoutthebookattheappropriatetime.Attheendofthischapter,youwillfindpointersonhowtofindadditionalinformationonlineifyougetstuckorareuncertainaboutthebestwaytosolveproblems.Inthischapt
5、er,wewillcover:•InstallingPython,SciPy,matplotlib,IPython,andNumPyonWindows,Linux,andMacintosh•WritingasimpleapplicationusingNumPyarrays•GettingtoknowIPython•OnlineresourcesandhelpGettingStartedwithPythonLibrariesSoftwareusedinthisbookThesoftwareusedinth
6、isbookisbasedonPython,soyouarerequiredtohavePythoninstalled.Onsomeoperatingsystems,Pythonisalreadyinstalled.You,however,needtocheckwhetherthePythonversioniscompatiblewiththesoftwareversionyouwanttoinstall.TherearemanyimplementationsofPython,includingcomm
7、ercialimplementationsanddistributions.Inthisbook,wewillfocusonthestandardCPythonimplementation,whichisguaranteedtobecompatiblewithNumPy.YoucandownloadPythonfromhttps://www.python.org/download/.Onthiswebsite,wecanfindinstallersforWindowsandMacOSXaswellass
8、ourcearchivesforLinux,Unix,andMacOSX.ThesoftwarewewillinstallinthischapterhasbinaryinstallersforWindows,variousLinuxdistributions,andMacOSX.Therearealsosourcedistributionsifyoupreferthat.YouneedtohavePython2.4.xoraboveinst