【Python】How to extract a particular column from 1D array of tuples? - 101 Numpy Exercises
Q:
irisデータのspeciesカラムを取り出しなさい
A:
url = 'https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data' iris_1d = np.genfromtxt(url, delimiter=',', dtype=None) species = np.array([row[4] for row in iris_1d]) species[:5] #> array([b'Iris-setosa', b'Iris-setosa', b'Iris-setosa', b'Iris-setosa', #> b'Iris-setosa'], #> dtype='|S18')