【发布时间】:2017-04-27 11:48:47
【问题描述】:
我正在尝试在 Python 3.5 中使用 genfromtxt 修复数据集。但我不断收到下一个错误:
ndtype = np.dtype(dict(formats=ndtype, names=names))
TypeError: data type not understood
这是我正在使用的代码。任何帮助将不胜感激!
names = ["country", "year"]
names.extend(["col%i" % (idx+1) for idx in range(682)])
dtype = "S64,i4" + ",".join(["f18" for idx in range(682)])
dataset = np.genfromtxt(data_file, dtype=dtype, names=names, delimiter=",", skip_header=1, autostrip=2)
【问题讨论】:
标签: numpy python-3.5 genfromtxt