From the course: Data Analysis with Python and Pandas

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

NumPy arrays and array properties

NumPy arrays and array properties

- [Instructor All right, so the first data structure we're going to learn in this course is the NumPy Array. NumPy arrays are fixed size containers of items that are more efficient than Python lists or tuples for data processing. Some of the reasons why they're more efficient, they can only store a single data type. Any sort of mixed types will be stored as an object data type, which we can often think of as strings. They can be one dimensional or multi-dimensional. So we can mimic these tabular data structures that we see in SQL or Excel by adding multiple dimensions to an array, but a one dimensional array looks very much like a Python list. And finally, array elements can be modified, but the array size cannot change. So in some ways, we can think of these as a semi-mutable data type. We can't change the size of an array, but we can change elements within an array. The first and third bullets contribute to arrays being more efficient than Python lists or Python tuples. Because they…

Contents