python-numical(numpy库)

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

NumericalPythonDavidAscherPaulF.DuboisKonradHinsenJimHuguninTravisOliphantLawrenceLivermoreNationalLaboratory,Livermore,CA94566UCRL-MA-1285692LegalNoticeCopyright(c)1999.TheRegentsoftheUniversityofCalifornia.Allrightsreserved.Permissiontouse,copy,modify,anddistributethissoftwareforanypurposewithoutfeeisherebygranted,providedthatthisentirenoticeisincludedinallcopiesofanysoftwarewhichisorincludesacopyormodifi-cationofthissoftwareandinallcopiesofthesupportingdocumentationforsuchsoftware.ThisworkwasproducedattheUniversityofCalifornia,LawrenceLivermoreNationalLaboratoryundercon-tractno.W-7405-ENG-48betweentheU.S.DepartmentofEnergyandTheRegentsoftheUniversityofCali-forniafortheoperationofUCLLNL.DISCLAIMERThissoftwarewaspreparedasanaccountofworksponsoredbyanagencyoftheUnitedStatesGovernment.NeithertheUnitedStatesGovernmentnortheUniversityofCalifornianoranyoftheiremployees,makesanywarranty,expressorimplied,orassumesanyliabilityorresponsibilityfortheaccuracy,completeness,oruse-fulnessofanyinformation,apparatus,product,orprocessdisclosed,orrepresentsthatitsusewouldnotinfringeprivately-ownedrights.Referencehereintoanyspecificcommercialproducts,process,orservicebytradename,trademark,manufacturer,orotherwise,doesnotnecessarilyconstituteorimplyitsendorsement,recommendation,orfavoringbytheUnitedStatesGovernmentortheUniversityofCalifornia.TheviewsandopinionsofauthorsexpressedhereindonotnecessarilystateorreflectthoseoftheUnitedStatesGovernmentortheUniversityofCalifornia,andshallnotbeusedforadvertisingorproductendorsementpurposes.1.Introduction................................................................................9Acknowledgments................................................................................102.InstallingNumPy......................................................................11TestingthePythoninstallation.....................................................................11TestingtheNumericPythonExtensionInstallation......................................11InstallingNumPy..........................................................................................11OnWin32.............................................................................................12OnUnix................................................................................................123.TheNumTutpackage..............................................................13TestingtheNumTutpackage.......................................................................13Possiblereasonsforfailure:.........................................................................13Win32...................................................................................................13Unix......................................................................................................144.High-LevelOverview...............................................................15ArrayObjects...............................................................................................15UniversalFunctions......................................................................................16ConvenienceFunctions................................................................................16RandomArray...............................................................................................17FFT...............................................................................................................17LinearAlgebra...............................................................................................185.ArrayBasics.............................................................................19Basics...........................................................................................................19Creatingarraysfromscratch........................................................................20array()andtypecodes..........................................................................20MultidimensionalArrays.......................................................................21Creatingarrayswithvaluesspecified`on-the-fly'.........................................25zeros()andones()................................................................................25arrayrange()..........................................................................................25Creatinganarrayfromafunction:fromfunction().................................26TableofContentsividentity()................................................................................................28CoercionandCasting...................................................................................28AutomaticCoercionsandBinaryOperations.......................................28Deliberateup-casting:Theasarrayfunction.........................................29Thetypecodevaluetable.....................................................................29Consequencesofsilentupcasting........................................................30Deliberatecasts(potential

1 / 93
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功