Web Technologies - NumPy

Back to Course

Lesson Description

Lession - #293 NumPy Getting Started

Installing Numpy

1. Mac and Linux users can install NumPy via pip command:
pip install numpy

Since windows has no package manager like that in linux or macintosh. Whenever you've downloaded proper .whl document from the connection, open up the command prompt. Explore to the directory where you've downloaded the .whl file. At last introduce it utilizing the command:
pip install name_of_the_file.whl

Note: If you are chipping away at Anaconda, you don't have to install NumPy as it is as of now installed with Anaconda. By the by you can install any package/library in Anaconda by means of command:
conda install name_of_the_package
# conda install numpy

To involve Numpy library in our program all you really want to do in to import it.
import numpy as np

Introduction to arrays in NumPy

A NumPy array is homogeneous lattice of values. In NumPy aspects of array are called axes. The quantity of axes is called rank. A tuple of non-negative integers giving the size of the array along each aspect is called its shape. For instance consider the 2D array beneath.
[[11, 9, 114]
 [6, 0, -2]]

  1. This array has 2 axes. First axis of length 2 and second axis of length 3.
  2. Rank = Number of axes = 2.
  3. Shape can be communicated as : (2, 3>

Scientific Library for Python. ... pip install scipy ... SciPy (pronounced “Sigh Pie”>
is open-source software for mathematics, science
Python List Slicing ... With this operator, one can specify where to start the slicing, where to end, and specify the step.
There are two ways to create empty NumPy array can be created: numpy.zeros and numpy.empty .
NumPy Data Types · i – integer · b – boolean · u – unsigned · f – float · c – complex float · m – timedelta · M – datetime · O – object ...
Numpy Factorial Function · Python numpy numpy.math.factorial(num>
method accepts a positive integer number as a argument.