What is the difference between Python's list methods append and extend? Please clearly define what you want. Find centralized, trusted content and collaborate around the technologies you use most. What is a word for the arcane equivalent of a monastery? Level up your programming skills. Is it correct to use "the" before "materials used in making buildings are"? print(int is np.int) # True a = np.array( [1, 2, 3], dtype=int) print(a.dtype) # int64 a = np.array( [1, 2, 3], dtype='int') print(a.dtype) # int64 Did this satellite streak past the Hubble Space Telescope so close that it was out of focus? An integer object can be constructed using a number or a string. We can convert to ints - except notice that the largest one is too large the default int32 In [208]: x.astype (int) Out [208]: array ( [ 1000000000, -2147483648, 1000000]) In [212]: x.astype (np.int64) Out [212]: array ( [ 1000000000, 20000000000, 1000000], dtype=int64) ..but that may not matter, since you may be using a trusted data source. Redoing the align environment with a specific formatting. The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide, I tried what you wrote but it didn't return the same as you did: >>>num =132 >>>map(int, str(num))