当前位置:网站首页>01 numpy introduction
01 numpy introduction
2022-07-01 08:14:00 【Lazy smile】
What is? NumPy(Numerical Python)
NumPy yes Python The basic package of scientific computing in , It's a Python library , Provide multidimensional array objects , Various derived objects ( Such as mask array and matrix ), And various methods for fast array operation API, Include mathematics 、 Logic 、 Shape operation 、 Sort 、 choice 、 Input and output 、 Discrete Fourier transform 、 Basic linear algebra , Basic statistical operations and stochastic simulation etc. .NumPy Fully support object-oriented Methods .
NumPy The forerunner of Numeric The first is the Jim Hugunin Developed with other collaborators ,2005 year ,Travis Oliphant stay Numeric Another library of the same nature is combined in Numarray The characteristics of , And added other extensions and developed NumPy.NumPy Developed for open source and maintained by many collaborators .
NumPy The history of can be traced back to 90 The mid - , Its predecessor is Numeric( use C Language writing , It is mainly used to fetch C++ Application in ) and Numarray( Used to process high-dimensional arrays , Flexible indexing 、 Data type transformation 、 Radio, etc ),2005 Years of NumPy As a successor , Absorbed Numeric Rich in C API And Numarray High dimensional array processing power , Become Python Scientific computing is the foundation of ecosystem
NumPy The core of the package is ndarray object . It encapsulates the python Of the same data type n Dimension group , In order to ensure its excellent performance , Many of these operations are performed after the code is compiled locally .
NumPy It's a very fast math library , Mainly used for array calculation , contain :
- A powerful N Dimensional array object ndarray
- Broadcast function
- Integrate C/C++/Fortran Code tools
- linear algebra 、 The Fourier transform 、 Random number generation and other functions
Why? NumPy So fast
1, The bottom is C, Part of it is Fortran
2, In addition to using C outside ,numpy Has its own set of instructions . It can improve the running speed .
3, stay R There is a thing called vectorization programming . Speed is directly based on embedded data structures 100 About times .
Vectorization describes that there are no explicit loops in the code , Index, etc. . These are precompiled C In the code “ Behind the scenes ” Results of optimization . Without vectorization , Our code will be unreadable and inefficient for Troubled by the cycle . Vectorization code has many advantages , These include :
- Vectorization code is more concise , Easier to read
- Fewer lines of code usually means fewer errors
- The code is closer to the standard mathematical notation ( Usually , It is easier to correctly code the mathematical structure )
- Vectorization leads to more “Pythonic” Code .
Generally speaking , stay NumPy in , All operations , Not just arithmetic , It is Logic , position , function etc. , In this implicit element by element way , That is, they broadcast .
边栏推荐
- How to get a SharePoint online site created using the office365 group template
- [force deduction 10 days SQL introduction] Day9 control flow
- How outlook puts together messages with the same discussion
- Book of quantitative trading - reading notes of the man who conquers the market
- [staff] high and low octave mark (the notes in the high octave mark | mark range are increased by one octave as a whole | low octave mark | mark range are decreased by one octave as a whole)
- [getting started] intercepting strings
- 力扣每日一题-第31天-1502.判断能否形成等差数列
- Five combination boxing, solving six difficult problems on campus and escorting the construction of educational informatization
- 防“活化”照片蒙混过关,数据宝“活体检测+人脸识别”让刷脸更安全
- String coordinates of number to excel
猜你喜欢

Serial port oscilloscope software ns-scope

OJ输入输出练习
![[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order](/img/87/07783593dbabcf29700fa207ecda08.png)
[getting started] enter the integer array and sorting ID, and sort its elements in ascending or descending order

Instead of houses, another kind of capital in China is rising

【入门】截取字符串

Gdip - hatchbrush pattern table

使用beef劫持用戶瀏覽器

軟鍵盤高度報錯
![[redis] it takes you through redis installation and connection at one go](/img/ca/89cb18f0eeb835f021d6a2489681a1.png)
[redis] it takes you through redis installation and connection at one go

一套十万级TPS的IM综合消息系统的架构实践与思考
随机推荐
Transaction method call @transactional
Provincial election + noi Part III tree problems
EDA open source simulation tool verilator beginner 6: debugging examples
Access报表实现小计功能
Lm08 mesh series mesh inversion (fine)
Provincial election + noi Part VI skills and ideas
初学者如何正确理解google官方建议架构原则(疑问?)
seaborn clustermap矩阵添加颜色块
01 NumPy介绍
How to get a SharePoint online site created using the office365 group template
Aardio - 自己构造的getIconHandle的方法
力扣每日一题-第32天-1822.数组元素积的符号
Li Kou daily question - Day 32 -1822 Symbol of array element product
Gru of RNN
go通用动态重试机制解决方案的实现与封装
How outlook puts together messages with the same discussion
Stack implementation calculator
Rumtime 1200 upgrade: London upgrade support, pledge function update and more
如何使用layui将数据库中的数据以表格的形式展现出来
The difference between interceptors and filters
