Python 3 Basics # 6 | Numpy Array | Create | Access | Update | Slice | Basic Operation | Functions
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
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuOjFcbnXLFvSQaHFK3ymUW
2. Confusion Matrix in Machine Learning, ML, AI
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvXzvsEcgb0IZtNsw_0vUzr
3. Anaconda, Python Installation, Spyder, Jupyter Notebook, PyCharm, Graphviz
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsBCsWwz_BvbZZHIVQ6wSZK
4. Cross Validation, Sampling, train test split in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsHtol5WXHhq_B3kQPggHH2
5. Drop and Delete Operations in Python Pandas
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtvqVVK7QVFsMvDvp2YgCnR
6. Matrices and Vectors with python
https://www.youtube.com/playlist?list=PLE-8p-CwnFPsndwnZnL7nXW5mIrdRmgdg
7. Detect Outliers in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvyCX35yES5D9W7vThiUzwk
8. TimeSeries preprocessing in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPv10bru3719xzDNIgbO6hXA
9. Handling Missing Values in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvOec0LZ40Bt8OQcbLFa236
10. Dummy Encoding Encoding in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPvu7YriqMZsL9UDbqUUk90x
11. Data Visualisation with Python, Seaborn, Matplotlib
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuYBYsmbfMjROOCzKjCwyMH
12. Feature Scaling in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtwpVV3FwzwYZYR5hT3i52G
13. Python 3 basics for Beginner
https://www.youtube.com/playlist?list=PLE-8p-CwnFPu-jseUMtc4i47jQZN4PNbf
14. Statistics with Python
https://www.youtube.com/playlist?list=PLE-8p-CwnFPta0COlxS6E5u14m5ouzbRU
15. Data Preprocessing in Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPuOjFcbnXLFvSQaHFK3ymUW
16. Sklearn Scikit Learn Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPtAGb29r8F7up9ilZUXt3l1
17. Linear Regression, Supervised Machine Learning
https://www.youtube.com/playlist?list=PLE-8p-CwnFPslDi6sfFbFK4KXcVlLwaOM
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Python 3 Basics # 6 | Numpy Array | Create | Access | Update | Slice | Basic Operation | Functions», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.