In this appendix , I will go deep into NumPy Array calculation of library . This will include ndarray More internal details , And more advanced array operations and algorithms .
This chapter includes a few messy chapters , You don't need to study it carefully .
NumPy Of ndarray It provides a way to integrate homogeneous data blocks ( It can be continuous or across ) How to interpret as a multidimensional array object . As you have seen before , data type (dtype) Determines how the data is interpreted , Floating point numbers, for example 、 Integers 、 Boolean value, etc .
ndarray Part of the reason why this is so powerful is that all array objects are a spanning view of data blocks (strided view). You might want to know about array views arr[::2,::-1] Why not replicate any data . In short ,ndarray Not just a piece of memory and a dtype, It also has span information , This allows the array to move in various steps (step size) Move in memory . To be more precise ,ndarray The interior consists of :
chart A-1 It simply explains ndarray The internal structure of .
for example , One 10×5 Array of , Its shape is (10,5):