An array is a grid of values and it contains information about the raw data, how to locate an element, and how to interpret an element.
Numpy vs Python List
Advantages of using NumPy Arrays over Python List:
Consumes less memory.
Fast as compared to the Python List.
Convenient to use.
Let’s look at the example of NumPy Array and Python List.
Importance of NumPy Array in Python
Wide verity of mathematical operations on Arrays.
It supplies an enormous library of high-level mathematical function that operate on these Arrays and metrices.
Mathematical, logical, shape, manipulation, sorting, selecting, I/O, discrete Fourier transforms, basic linear algebra, basic statistical operations, random simulation and much more.
Creating NumPy Arrays
To create a NumPy Array, you can use the function np.array().
Dimensions in Array
1-D Arrays
2-D Arrays
3-D Arrays
High Dimensional Arrays
Special NumPy Arrays
Array filled with 0’s
Array files with 1’s
An Array with a range of elements
Array diagonal element filled with 1’s
Create an array with values that are spaced linearly in a specified interval.
Conclusion
In this article we have learned what is NumPy and how to create 1-D, 2-D, 3-D and High dimensional arrays in it, in the next part we will be learning how to create NumPy Arrays with Random Numbers.