简体   繁体   中英

How to change floating point precision in Python?

I want to change my numpy array floating point resolution so it can only have 2 decimal places. Not to print out the value to the command window but the way the value is actually represented in memory!

numpy.round(your_array,2)

Should make it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM