0% found this document useful (0 votes)
8 views25 pages

Arrays

arrays in python

Uploaded by

ANU JAYAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views25 pages

Arrays

arrays in python

Uploaded by

ANU JAYAN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 25

ARRAYS

NumPy package

 Numerical python
 Advanced computing in pythonLinear
algebra,Fourier transform
 Usually imported as np
 Import numpy as np
To install numpy

Type in terminal
 pip install numpy
or
 pip3 install numpy
Any module can be imported with
another name
import math as ma
a=ma.sqrt(9)
print(a)
ARRAYS

 homogeneous collection of data items


import numpy as np
ar1=np.array([1,2,3,4,5,6])
print(ar1)

output
[1 2 3 4 5 6]
import numpy as n1
ar1=n1.array([1,2,3,4,5,6])
print(ar1)
MATRICES USING ARRAYS

import numpy as np
mat1=np.array([[1,2,3],
[4,5,6]])
print(mat1)
ARRAY DIMENSIONS
Size
across
each
dimension-
shape
ACCESSING
ARRAY
ELEMENTS
For loop
to
traverse
array
reshapin
g
MATRIX OPERATIONS-ADDITION,
MULTIPLICATION ,SUBTRACTION
SIZES OF MATRICES-SHOUL BE COMPATIBLE FOR
ADDITION,SUBTRACTION & MULTIPLICATION-ELSE ERROR

You might also like