Professional Documents
Culture Documents
In [ ]: #Agenda:
1. Data Science Libraries(Packages)
- Numpy - for numrical scientific data
- Pandas - data analysis,data cleaning, data manuplation.
- MatPlotLib-- for representing data along with 2D graphics.
- what is numpy ?
- who is created ?
--- Numpy array is a powerful N-dimensional array object which is in the form of rows and columns.
--- we can create / initialize Numpy arrays from nested lists and access it elements.
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 1/12
10/23/2020 Day -17 [Data Science Libraries]
(3,)
(2, 3)
int32
(5,)
float64
(2, 3)
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 2/12
10/23/2020 Day -17 [Data Science Libraries]
1
2
3
1
(8,)
before reshape= [1 2 3 5 6 7 8 9]
after reshape= [[1 2 3 5]
[6 7 8 9]]
2
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 3/12
10/23/2020 Day -17 [Data Science Libraries]
8
8
[ 2 3 4 5 6 78 8 9]
[2 3 4]
[[2 3 4]
[0 0 0]
[0 0 0]]
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 4/12
10/23/2020 Day -17 [Data Science Libraries]
[ 0 3 6 9 12 15 18 21 24 27]
(10,)
1
[0 1 2 3 4 5 6 7 8]
[[0 1 2]
[3 4 5]
[6 7 8]]
2
(3, 3)
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 5/12
10/23/2020 Day -17 [Data Science Libraries]
In [84]: #arrays with linspace(): generate an array with evenly spaced values in start,stop, internal values
import numpy as np
n1 = np.linspace(1,12,2)
print(n1)
n2 = np.linspace(1,12,4)
print(n2)
n3 = np.linspace(1,12,12).reshape(4,3)
print(n3)
[ 1. 12.]
[ 1. 4.66666667 8.33333333 12. ]
[[ 1. 2. 3.]
[ 4. 5. 6.]
[ 7. 8. 9.]
[10. 11. 12.]]
[0. 0. 0.]
[[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]
[0 0 0 0 0]]
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 6/12
10/23/2020 Day -17 [Data Science Libraries]
[1. 1. 1.]
[[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]
[1 1 1 1 1]]
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 7/12
10/23/2020 Day -17 [Data Science Libraries]
[[0.14434897 0.15249655]
[0.14580567 0.26094583]
[0.21622084 0.4140911 ]]
[[ 0.84452813 1.46246017]
[ 1.66225143 1.60609929]
[-0.63165689 1.64322504]]
[[ 3 9 2 12]
[14 12 14 2]]
Data Science
Machine Learning
['python' 'Data Science' '500']
['50' '80.9' '50.3']
['90.5' 'Machine Learning']
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 8/12
10/23/2020 Day -17 [Data Science Libraries]
[[1 2 3]
[4 5 6]]
[[ 6 8 9]
[10 12 15]]
[[ 1 2 3 6 8 9]
[ 4 5 6 10 12 15]]
[[ 1 2 3]
[ 4 5 6]
[ 6 8 9]
[10 12 15]]
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 9/12
10/23/2020 Day -17 [Data Science Libraries]
[[ 54 80 86]
[135 116 140]]
[[-46 -70 -74]
[ 45 -4 -40]]
[[ 200 375 480]
[4050 3360 4500]]
[[0.08 0.06666667 0.075 ]
[2. 0.93333333 0.55555556]]
[[ 0 1178063325 0]
[ 0 0 0]]
[[ 9 10 11]
[95 61 55]]
[[500 750 800]
[450 600 900]]
[[ 51 60 69]
[825 519 465]]
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 10/12
10/23/2020 Day -17 [Data Science Libraries]
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 11/12
10/23/2020 Day -17 [Data Science Libraries]
In [181]: #full array: we can create an array with specified dimesion and with specified number)
#syntax: full(dimenison,specified number)
a1 = np.full((5,3),"ABC")
a1
In [ ]:
localhost:8888/nbconvert/html/Desktop/Python_Online_Programmingg/Day -17 %5B Python Data Science Libraries%5D/Day -17 %5BData Science Libraries%5D.ipynb?download=false 12/12