Python 3 Basics # 6 | Numpy Array | Create | Access | Update | Slice | Basic Operation | Functions

Pubblicato il: 18 ottobre 2018
sul canale di: technologyCult
1,540
13

Python 3 Basics # 6 | Numpy Array | Create | Access | Update | Slice | Basic Operation | Functions

Python Basics - Session 6

Topic to be covered - Numpy in Python

1. What is Numpy
2. Creating Numpy
3. Accessing Numpy elements
4. Updating Numpy
5. Indexing / Slicing in Numpy
6. Basic Operations in Numpy
7. Functions using Numpy
mean, max, min, sort, var, std, argmin, argmax, nonzero, where, extract,
8. Broadcasting in Numpy
9. Numpy String Functions
10. Storage Comparision between List and Numpy
11. Processing time comparision between LiSst and Numpy
12. Matrix / Linear Algebra using Numpy
13. Iterations with Numpy
14. Numpy - converting to hexadecimal
15. I/O with Numpy
16. Matplotlib with Numpy - Various options to be explored


1. What is Numpy ?
a. Numpy is a library for scientific computing.
b. Numpys stands for Numerical Python.
c. Numpy consists of Multidimensional array objects and it has collection of
functions/routines to process those arrays.
d. There are advantages of using Numpy
i. Takes less memory as compared to List
ii. Processing speed of num

2. How do we create numpy array?

Code Starts Here
==============
import numpy as np

x = np.array([1,2,3])
print(x)

print(x.dtype)

x = np.array([1,2,3.0])
print(x.dtype)
print(x)

x = np.array([10,20,30,40,50], ndmin = 3)
print(x)
print(x.size)
print(x.shape)

3. Accessing Numpy Elements

x = np.array([10,20,30,40,50])
print(x[2])
print(x[-1])
print(x[-3])

4. Updating Numpy array

print(x)
x[2] = 80
print
5. Indexing / Slicing in Numpy

Type 1

x = np.arange(10)

s = slice(2,9,2)
print(x[s])
print(x[slice(0,8,2)])
print(x[slice(1,8,3)])

print(x[0:8:2])
print(x[1:8:3])

x = np.arange(20)
y = x[10]
print(y)

y = x[:10]
print(y)

y = x[10:]
print(y)

print(y[2:8])

print(y[2:10:2])
print(y[2:10:3])


x = np.array([[10,20,30], [40,50,60], [70,80,90]])
print(x)
'''
[[10 20 30] ----- 0
[40 50 60] ----- 1
[70 80 90]] ----- 2
'''

print(x[1:])
print(x[2:])
print(x[0:])
print(x[3:])

print(x[:,0])
print(x[:,1])
print(x[:,2])

""" 6. Basic Operations in Numpy"""


x = [10,20,30]
y = [30,60,70]

print(x + y)
print(y / 10)

x = np.array([10,20,30])
y = np.array([30,60,70])

print(x+y)
print( y / 10)

print ( x * 10)

"""7. Functions using Numpy
mean, max, min, sort, var, std, argmin, argmax, nonzero, where, extract """

Sachin_runs = np.array([110,105,155,0,191,174,0])

print(np.mean(Sachin_runs))
print(np.min(Sachin_runs))
print(np.max(Sachin_runs))
print(np.var(Sachin_runs))
print(np.std(Sachin_runs))
print(np.argmax(Sachin_runs))
print(np.argmin(Sachin_runs))
print(np.nonzero(Sachin_runs))

print(np.where(Sachin_runs GT 120))

condition = (Sachin_runs GT 100) & (Sachin_runs LT 160)
print(np.extract(condition, Sachin_runs))


All the playlist of this youtube channel
========================================

1. Data Preprocessing in Machine Learning
   • Data Preprocessing in Machine Learnin...  

2. Confusion Matrix in Machine Learning, ML, AI
   • Confusion Matrix in Machine Learning,...  

3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
   • Anaconda | Python Installation | Spyd...  

4. Cross Validation, Sampling, train test split in Machine Learning
   • Cross Validation | Sampling | train t...  

5. Drop and Delete Operations in Python Pandas
   • Drop and Delete Operations in Python ...  

6. Matrices and Vectors with python
   • Matrices and Vectors with python  

7. Detect Outliers in Machine Learning
   • Detect Outliers in Machine Learning  

8. TimeSeries preprocessing in Machine Learning
   • TimeSeries preprocessing in Machine L...  

9. Handling Missing Values in Machine Learning
   • Handling Missing Values in Machine Le...  

10. Dummy Encoding Encoding in Machine Learning
   • Label Encoding, One hot Encoding, Dum...  

11. Data Visualisation with Python, Seaborn, Matplotlib
   • Data Visualisation with Python, Matpl...  

12. Feature Scaling in Machine Learning
   • Feature Scaling in Machine Learning  

13. Python 3 basics for Beginner
   • Python | Python 3 Basics | Python for...  

14. Statistics with Python
   • Statistics with Python  

15. Data Preprocessing in Machine Learning
   • Data Preprocessing in Machine Learnin...  

16. Sklearn Scikit Learn Machine Learning
   • Sklearn Scikit Learn Machine Learning  

17. Linear Regression, Supervised Machine Learning
   • Linear Regression | Supervised Machin...  


In questa pagina del sito puoi guardare il video online Python 3 Basics # 6 | Numpy Array | Create | Access | Update | Slice | Basic Operation | Functions della durata di ore minuti seconda in buona qualità , che l'utente ha caricato technologyCult 18 ottobre 2018, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 1,540 volte e gli è piaciuto 13 spettatori. Buona visione!