【发布时间】:2013-05-06 13:05:30
【问题描述】:
getValues() 方法中,AFXComTableKeyword 类返回如下字符串:
test = "('mat_huehne_2008', '0.125', '24.0'),('', '', '-24.0'),('', '', '41.0')"+\
",('', '', '-41.0'),('', '', ''),('', '', ''),('', '', ''),('','', ''),"+\
"('', '', ''),('', '', ''),('', '', ''),('', '', ''),('', '', ''),"+\
"('', '', ''),('', '', ''),('', '', ''),('', '', ''),('', '', ''),"+\
"('', '', ''),('', '', ''),('', '', ''),('', '', ''),('', '', ''),"+\
"('', '', ''),('', '', ''),('', '', ''),('', '', ''),('', '', ''),"+\
"('', '', ''),('', '', ''),('', '', ''),('', '', ''),('', '', ''),"+\
"('', '', ''),('', '', ''),('', '', ''),('', '', ''),('', '', ''),"+\
"('', '', ''),('', '', '')"
最后,我们需要shape=(40,3) 中的numpy.array,对于这种情况,它看起来像:
test = [['mat_huehne_2008', '0.125', '24.0'],
[ '', '', '-24.0'],
... and so on ... ]
有谁知道在 Python / Numpy 中执行此操作的捷径吗?
【问题讨论】: