넘파이의 특징

넘파이 호출

import numpy as np

test_array = np.array([1,4,5,8],float)
print(test_array)
#array([1., 4., 5., 8.])
type(test_array[3])
#numpy.float64 / 64는 64비트라는 뜻

Array Creation

import numpy as np

test_array = np.array([1,4,5,"8"],float)

print(type(test_array[3]))  #float type으로 자동 형변환
print(test_array.dtype)  #배열 전체의 데이터타입 밚
print(test_array.shape)  #배열의 shape을 반환

shape : numpy array의 object의 dimension 구성을 반환

dtype : numpy array의 데이터 type을 반환

Untitled

Untitled

Untitled

ndim : number of dimension

size : 전체 데이터의 갯수