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]
Laravel 5.5 - Task Scheduling With Cron Job Example
Today, we are share in this tutorials &q...jQuery val method
In this article, we will learn how you c...Javascript selector
With Javascript, you can change HTML ele...How To Compile and Install Software from Source on Ubuntu
Modern Linux distributions comes with re...How to create a PHP package for Composer
PHP has become more popular programing l...