Back Navigation Next Navigation External Packages (page 9 of 38)

The core numpy object that we will work with in this course is the ndarray (multi-dimensional array). All elements in an ndarray must be of same data type and the shape must be symetrical (i.e., all dimensions must have the same shape). An ndarray allows us to perform fast and memory efficient operations on data, which is why it is such a powerful data structure. The following example shows three different numpy arrays with different shapes and data types. Notice how the ndarrays have hard brackets, but there are no commas between the items.

Numpy Assorted Tasks