np.set_printoptions方法的相关属性:
set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, suppress=None, nanstr=None, infstr=None)
对于每个属性的释义:
precision : int, optional,float输出的精度,即小数点后维数,默认8( Number of digits of precision for floating point output (default 8))
相关推荐:《python视频教程》
threshold : int, optional,当数组数目过大时,设置显示几个数字,其余用省略号(Total number of array elements which trigger summarization rather than full repr (default 1000))
edgeitems : int, optional,边缘数目(Number of array items in summary at beginning and end of each dimension (default 3))
linewidth : int, optional,The number of characters per line for the purpose of inserting line breaks (default 75)
suppress : bool, optional,是否压缩由科学计数法表示的浮点数(Whether or not suppress printing of small floating point values using scientific notation (default False))
nanstr : str, optional,String representation of floating point not-a-number (default nan)
infstr : str, optional,String representation of floating point infinity (default inf)
实例:
np.set_printoptions(threshold='nan') (意思是全部打印)
新闻名称:创新互联Python教程:python如何显示数组
本文链接:http://www.mswzjz.cn/qtweb/news23/418273.html
攀枝花网站建设、攀枝花网站运维推广公司-贝锐智能,是专注品牌与效果的网络营销公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 贝锐智能