为什么Numpy1.14不支持维度大于2的数组的savetxt,而1.13似乎支持这个?

2024-04-25 23:29:50 发布

您现在位置:Python中文网/ 问答频道 /正文

这种差异可以在文档中看到。你知道吗

1.13 docs

X : array_like

1.14 docs

X : 1D or 2D array_like

Data to be saved to a text file.


Tags: ortotext文档docsdata差异be
2条回答

它从不支持维度为0或大于2的数组。docstring和错误处理刚刚从1.13改进到1.14,以更好地反映这一点。你知道吗

您可以在pull请求中看到自己的提交:ENH: Better error message for savetxt when X.ndim > 2 or X.ndim = 0

While 1.13 seems to support that

1.13中不支持它。1.14刚刚改进了错误消息:

1.13.0

TypeError: Mismatch between array dtype ('int32') and format specifier ('%.18e %.18e %.18e %.18e')

1.14.0

ValueError: Expected 1D or 2D array, got 4D array instead

相关问题 更多 >