Matrices and Vectors with Python | Create | Access | Delete - P1
Matrices and Vectors with Python | Create | Access | Delete - P1
Session No 1
Topic to be covered -
1. How to create Matrices
2. How to create random matrices of different orders
3. How to access the matrices elements
4. How to delete rows and column of a matrix.
#technologycult #matrix #vectors #machinelearning #artificialintelligence #matricesandvectors
Q) What is Matrix?
Matrix is a rectangular array of numbers, symbols or expression arranged in rows and columsn.
Q) Where do we use matrix in Machine Learning?
Matrix are used to read the input data which is in the form of .csv, .txt, .xml and other formats.
It is especially used to processed as the input data varible (X) when training the algorithm.
Code Start Here
==================
import numpy as np
1. How to create Matrices
matrix = np.array([[3,4],
[5,8]])
How to create using random
How to create random matrices of different orders
print(np.random.random((2,2)))
print(np.random.random((3,3)))
print(np.random.random_integers(0,9,(2,2)))
print(np.random.randint(0,100,(5,5)))
3. How to access the matrices elements
x = np.random.randint(0,100,(5,5))
Extract the first column
x[:,0]
Extract the Second Column
x[:,1]
# Extract the first row
x[0]
x[2]
How to extract the 2nd and 4th row
x[[2,4]]
How to extract the 1st and 4th Column
y = x[:,[1,4]]
4. How to delete rows and column of a matrix.
How to delete the second row
np.delete(x,[1],0)
How to delete the second column
np.delete(x,[1],1)
Delete second and third row
np.delete(x,[[2,3]],0)
Delete second and third column
np.delete(x,[[2,3]],1)
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Matrices and Vectors with Python | Create | Access | Delete - P1», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.