Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import numpy as np
  2.  
  3. GDP_2017 = 19519400000000
  4. GDP_2016 = 18707200000000
  5.  
  6. GDP = np.array([GDP_2016, GDP_2017])
  7.  
  8. #Within the dictionary we have to set the datatype and format specification
  9. np.set_printoptions(formatter={'int': '{:,}'.format})
  10.  
  11. print('Print the GDP and datatype after formatting')
  12. print(GDP)
  13. print(GDP.dtype)
  14.  
  15. #We reset the default settings
  16. np.set_printoptions()
  17.  
  18. print('\nPrint the GDP and datatype after reset formatting')
  19. print(GDP)
  20. print(GDP.dtype)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement