Array attributes in numpy || numpy|| numeric python|| || Ak

Опубликовано: 03 Январь 2019
на канале: CSE TECH'S
160
10

import numpy as np

a = np.array([[1,2,3],[4,5,6]])#that means its 2darray of 3element in each
print (a.shape)#just printing the shape of our array


this resizes the ndarray
a = np.array([[1,2,3],[4,5,6]])
a.shape = (3,2) #w want to make it 3d array
print (a)#3d array of 2elements



#numpy also prov
a = np.array([[1,2,3],[4,5,6]])
b = a.reshape(3,2)
print (b)# can be done same task with reshape keyword



an array of evenly spaced numbers
a = np.arange(20)
print (a)
#evenly spaced usefull for next videos of numpy

this is one dimensional array
a = np.arange(24)
b=a.ndim #count dim
print(b)

now reshape it
b = a.reshape(2,4,3) #2d array of 4col and 3rows
print(b)
b is having three dimensions


#dtype of array is int8 (1 byte)

x = np.array([1,2,3,4,5], dtype = np.int8)
x = np.array([1,2,3,4,5], dtype=np.complex128)
x = np.array([1,2,3,4,5], dtype=np.float64)
print (x.itemsize)#differs on datatypes


На этой странице сайта вы можете посмотреть видео онлайн Array attributes in numpy || numpy|| numeric python|| || Ak длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь CSE TECH'S 03 Январь 2019, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 160 раз и оно понравилось 10 зрителям. Приятного просмотра!