【发布时间】:2013-05-26 15:59:51
【问题描述】:
我执行以下操作:
from numpy import genfromtxt
x = genfromtxt('foo.csv',delimiter=',',usecols=(0,1))
y = genfromtxt('foo.csv',delimiter=',',usecols=(2),dtype=str)
然后我输入:
x[y=='y1Out',0] # assume the set of "y" is 'y1Out' and 'y2Out'
该命令在“x”中打印所有“0 列”值,其关联的“y”值等于y1Out。这怎么可能?也就是说,numpy 如何跟踪“x”和“y”之间的对齐方式?我以为 numpy 没有数据对齐。
【问题讨论】:
标签: python numpy alignment slice