Python is the most popular general purpose programming language used in machine learning, data science, web application etc. Python has so many packages for machine learning, data-science and data analysis like, Matplotlib, Pandas, SciPy, Tensor-Flow, Keras etc. One of the basic package is Numpy.
Numpy is the basic package to manipulate data in Python. Numpy provides support for large, multi-dimensional arrays, various derived objects(such as masked arrays and matrices), for scientific calculation in linear algebra and matrices.Numpy is largely used in all machine-learning packages like Matplotlib, Pandas, SciPy, Tensor-Flow, Keras etc.
Numpy is not preinstalled with Python. You have to install Numpy addtionally. In this article, we will discuss about installation and how to use Numpy.
Linux and Mac users can directly install Numpy with pip command.
pip install numpy
To Install Numpy in Windows system, download Anaconda which is open-source distribution of the Python and R programming languages including Numpy and many popular packages.
You can check if Numpy is installed correctly by running bellow command. It will display all your pip installed packages.
pip list
Whenever you want to use Numpy in your script, first import Numpy module in above the script.
import numpy as np
Now you can use all Numpy functions. Lets first create simple Numpy array. For that first create file index.py
file and put bellow code which will print array variable.
import numpy as np
# create numpy array
x = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
# print array
print(x)
Now go to Terminal in the file location and run script with bellow command.
python index.py
This way, you can run Python script from your Terminal. In the next part, we will discuss on Basic functions to create and manipulate Numpy array.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
How to Crop Image before Upload using Cropper Js in Laravel 7.x
Hi Guys, In this tutorial,I will lear...React Bootstrap Navbar Example
Bootstrap is easy to create responsive w...How to Remove a Specific Item from an Array in JavaScript
Use the splice() Method You can use t...addMore.js jQuery Plugin To Duplicate Form Group
jQuery has many important and magical pl...Laravel 8 Load More Data on Page Scroll using Jquery Ajax
You have already known about Twitter and...