您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 能源与动力工程 > 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
本文标题:python-numical(numpy库)
链接地址:https://www.777doc.com/doc-4680847 .html