Lecture 4
Lecture 4
NumPy ndarray
• Main object is homogeneous multidimensional array.
• Creating numpy array as vector.
• Creating numy array as matrix.
NumPy array and python list
• Numpy offers wide range of fast and efficient ways of creating arrays and manipulating
numerical data inside them
• List can contain different data types within a single list, all of the elements in a NumPy
array should be homogeneous
• NumPy arrays are faster and more compact than Python lists
• consumes less memory to store data and is convenient to use
Array Creation
• Import numpy
Fancy Indexing
Reshaping Arrays