Printing numpy.float64 with full precision

前端 未结 2 1213
北荒
北荒 2020-12-29 03:49

What is the proper/accepted way to print and convert a numpy.float64 to a string? I\'ve noticed just using print or str() will lose some precision

2条回答
  •  轮回少年
    2020-12-29 04:06

    The astype method works well:

    >>> numpy.float64('6374.345407799015').astype(str)
    '6374.345407799015'
    

提交回复
热议问题