반응형
Notice
Recent Posts
Recent Comments
Link
관리 메뉴

bro's coding

numpy.file open 본문

[IT]/python.numpy

numpy.file open

givemebro 2020. 3. 27. 17:30
반응형
import numpy as np

iris_labels = ['Iris-setosa', 'Iris-versicolor', 'Iris-virginica']

iris = np.loadtxt('iris.csv', skiprows=1, delimiter=',',
                  converters={4: lambda s: iris_labels.index(s.decode())})

# iris = np.loadtxt('iris.csv', skiprows=1, delimiter=',',
#                   converters={4: lambda s: labels.index(s)}, encoding='utf-8') # latin1, ascii, utf-8, cp949
반응형

'[IT] > python.numpy' 카테고리의 다른 글

numpy.corrcoef  (0) 2020.04.27
numpy.where.3단 논법  (0) 2020.04.23
numpy.브로드캐스팅  (0) 2020.03.30
numpy.무한대 처리  (0) 2020.03.30
numpy.스칼라 연산  (0) 2020.03.30
numpy.reshape(차원 변경)  (0) 2020.03.26
numpy.dtype이용 type변경  (0) 2020.03.26
numpy.shape and ndim  (0) 2020.03.26
Comments