要解压缩的值过多

时间:2016-02-09 02:34:23

标签: python abaqus

我正在尝试将一个dat文件作为数组导入我的python文件中。 dat文件有125行和5列,包含125个椭圆(X和Y坐标,小半径和大半径和角度)的信息。

这是我使用的命令:

int main()
{
char p[] = {};
char z[] = "Hello World";
ft_strcpy(p,z);
printf("%s\n", p);
return 0;
}

这就是我得到的错误

X_centers, Y_Centers, Small_Radii, Large_radii, Angles=np.loadtxt('C:\Hamid\Ellipses-1.dat',unpack=True)

1 个答案:

答案 0 :(得分:1)

发生此错误是因为numpy.loadtext的返回长度超过5个元素。查看numpy.loadtext的ref doc,听起来像是返回一个ndarray。

您可以使用以下内容开始调试:

debug_it = np.loadtxt('C:\Hamid\Ellipses-1.dat',unpack=True)
print len(debug_it)
print debug_it.shape
相关问题