【发布时间】:2022-01-21 09:06:34
【问题描述】:
如何使用 dtype=object 访问 numpy 数组中的数据?
b = numpy.array({"a":[1,2,3]}, dtype=object)
以下引发IndexError。
print(b["a"])
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
【问题讨论】:
标签: python numpy numpy-ndarray