NumPy ndarray - A Multidimensional Array Object

原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/12244066.html

ndarray

One of the key features of NumPy is its N-dimensional array object, or ndarray, which is a fast, flexible container for large datasets in Python. Arrays enable you to perform mathematical operations on whole blocks of data using similar syntax to the equivalent operations between scalar elements.

e.g

An ndarray is a generic multidimensional container for homogeneous data; that is, all of the elements must be the same type.

Every array has a shape, a tuple indicating the size of each dimension, and a dtype, an object describing the data type of the array:

Creating ndarrays

The easiest way to create an array is to use the array function. This accepts any sequence-like object (including other arrays) and produces a new NumPy array containing the passed data.

 

扫描二维码关注公众号,回复: 8950476 查看本文章

Reference

Python for Data Analysis Second Edition

猜你喜欢

转载自www.cnblogs.com/agilestyle/p/12244066.html