【发布时间】:2014-05-15 16:09:15
【问题描述】:
我想将类型为元组列表的缓冲区字符串加载到 numpy 数组中。
例如
numpy.fromstring('(1,2),(3,4),', dtype=numpy.int64)
ValueError:字符串大小必须是元素大小的倍数
但是我无法确定应该使用哪个 dtype 参数?
我不想选择numpy.array(eval('(1,2),(3,4),')),因为在某些情况下,元组的长度会更高...
【问题讨论】:
标签: python arrays numpy buffer eval