美文网首页我爱编程
[3 Printing Arrays]NumPy

[3 Printing Arrays]NumPy

作者: 涂大宝 | 来源:发表于2017-05-23 12:20 被阅读0次

当你print数组的时候, NumPy遵循下面的规则:

1.the last axis is printed from left to right,

2.the second-to-last is printed from top to bottom,

3.the rest are also printed from top to bottom, with each slice separated from the next by an empty line.

一维数组以行的形式展现,二维的会以行和列展现,三维的最后一个axis是以行的形式,另外都是从上到下的形式

可以通过下面这个例子获得更加直观的感受,当然,如果你想要强行让他展现全部的数字,可以用这个语句(👇):

>>>np.set_printoptions(threshold='nan')

相关文章

网友评论

    本文标题:[3 Printing Arrays]NumPy

    本文链接:https://www.haomeiwen.com/subject/tfwwxxtx.html