SHARE
TWEET

Untitled

a guest Sep 16th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top