程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python chapter 04 numpy Basics: array and vector calculation

編輯:Python

NumPy(Numerical Python For short ) yes Python Numerical calculation of the most important base package . Most of the packages that provide scientific calculations are used NumPy The array of .

NumPy Some of the functions are as follows :

  • ndarray, A fast and space-saving multidimensional array with vector arithmetic operations and complex broadcasting capabilities .
  • A standard mathematical function used to perform quick operations on an entire set of data ( No need to write a loop ).
  • Tools for reading and writing disk data and for manipulating memory-mapped files .
  • linear algebra 、 Random number generation and Fourier transform function .
  • For integration by C、C++、Fortran Such as the language written by the code A C API.

because NumPy Provides an easy to use C API, This makes it easy to pass data to external libraries written in low-level languages , External libraries are also available NumPy The array returns the data to Python. This feature enables Python Become a kind of packaging C/C++/Fortran Selection of historical code base , And make the wrapped library have a dynamic 、 Easy-to-use interface .

NumPy By itself, it does not provide much advanced data analysis , understand NumPy Arrays and array-oriented calculations will help you use them more efficiently pandas Something like that . because NumPy It's a big problem , I'll put it in the appendix A More on NumPy Advanced features , Such as radio, .

For most data analysis applications , The features I'm most focused on are :

  • For data collation and cleanup 、 Subset construction and filtering 、 Conversion and other fast vectorized array operations .
  • Common array algorithm , Such as sorting 、 The only change 、 Set operation, etc .
  • Efficient descriptive statistics and data aggregation / The operation .
  • For merging heterogeneous data sets / Data alignment and relational data operations for join operations .
  • Express conditional logic as an array expression ( Not with if-elif-else Branching cycle ).
  • Data grouping operation ( polymerization 、 transformation 、 Function application, etc. )..

although NumPy Provides general


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved