NumPy is a Python package which means ‘Numerical Python’. It is the library for logical computing, which contains a powerful n-dimensional array object, gives tools to integrate C, C++ and so on. It is likewise helpful in linear based math, arbitrary number capacity and so on. NumPy exhibits can likewise be utilized as an effective multi-dimensional compartment for generic data.
NumPy Array: Numpy array is a powerful N-dimensional array object which is in the form of rows and columns. We can initialize NumPy arrays from nested Python lists and access it elements. A Numpy array on a structural level is made up of a combination of:
- The Data pointer indicates the memory address of the first byte in the array.
- The Data type or dtype pointer describes the kind of elements that are contained within the array.
- The shape indicates the shape of the array.
- The strides are the number of bytes that should be skipped in memory to go to the next element.
Operations on Numpy Array
First array: [[ 0. 1.] [ 2. 3.]] Second array: [12 12] Adding the two arrays: [[ 12. 13.] [ 14. 15.]] Subtracting the two arrays: [[-12. -11.] [-10. -9.]] Multiplying the two arrays: [[ 0. 12.] [ 24. 36.]] Dividing the two arrays: [[ 0. 0.08333333] [ 0.16666667 0.25 ]]
This function returns the reciprocal of argument, element-wise. For elements with absolute values larger than 1, the result is always 0 and for integer 0, overflow warning is issued.
Our array is: [ 25. 1.33 1. 1. 100. ] After applying reciprocal function: [ 0.04 0.7518797 1. 1. 0.01 ] The second array is:  After applying reciprocal function: 
This function treats elements in the first input array as the base and returns it raised to the power of the corresponding element in the second input array.
First array is: [ 5 10 15] Applying power function: [ 25 100 225] Second array is: [1 2 3] Applying power function again: [ 5 100 3375]
This function returns the remainder of division of the corresponding elements in the input array. The function
numpy.remainder() also produces the same result.
First array: [ 5 15 20] Second array: [2 5 9] Applying mod() function: [1 0 2] Applying remainder() function: [1 0 2]
- Python | Broadcasting with NumPy Arrays
- Python Lists VS Numpy Arrays
- Convert Python List to numpy Arrays
- Python | Convert Numpy Arrays to Tuples
- Indexing Multi-dimensional arrays in Python using NumPy
- Convert Python Nested Lists to Multidimensional NumPy Arrays
- Accessing Data Along Multiple Dimensions Arrays in Python Numpy
- Vectorized Operations in NumPy
- numpy matrix operations | ones() function
- numpy matrix operations | eye() function
- numpy string operations | less() function
- numpy string operations | isspace() function
- numpy matrix operations | zeros() function
- numpy string operations | isupper() function
- numpy matrix operations | repmat() function
- numpy matrix operations | rand() function
- numpy string operations | rjust() function
- numpy string operations | translate() function
- numpy matrix operations | randn() function
- numpy string operations | zfill() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.