该
numpy.set_string_function函数可用于更改数组的字符串表示形式。
您还可以使用
numpy.set_print_options更改默认使用的精度,并关闭以科学计数法报告小数字的功能。
从以下示例中
set_print_options:
>>> np.set_printoptions(precision=4)>>> print np.array([1.123456789])[ 1.1235]

该
numpy.set_string_function函数可用于更改数组的字符串表示形式。
您还可以使用
numpy.set_print_options更改默认使用的精度,并关闭以科学计数法报告小数字的功能。
从以下示例中
set_print_options:
>>> np.set_printoptions(precision=4)>>> print np.array([1.123456789])[ 1.1235]