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.kswsj.com/qtweb/news23/418273.html
网站建设、网络推广公司-成都快上网,一家网站设计、网站制作公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 成都快上网