Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- GDP_2017 = 19519400000000
- GDP_2016 = 18707200000000
- GDP = np.array([GDP_2016, GDP_2017])
- #Within the dictionary we have to set the datatype and format specification
- np.set_printoptions(formatter={'int': '{:,}'.format})
- print('Print the GDP and datatype after formatting')
- print(GDP)
- print(GDP.dtype)
- #We reset the default settings
- np.set_printoptions()
- print('\nPrint the GDP and datatype after reset formatting')
- print(GDP)
- print(GDP.dtype)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement