Edit:
Using dtype for windows with numpy> 1.11.0:
As @John Y's suggestion, it seems possible to insert integers into the desired format, using dtypeas a named parameter with np.random.randint:
a = np.random.randint(2147483647, 9223372036854775807, size=3, dtype=np.int64)
[end edit]
You can create an array directly by setting the range for randint; this is probably more efficient than phasing the generation and aggregation of an array:
Docstring: (numpy randint)
randint(low, high=None, size=None)
size range if int 32:
ii32 = np.iinfo(np.int32)
iinfo(min=-2147483648, max=2147483647, dtype=int32)
size range for int64 ↔ c long
ii64 = np.iinfo(np.int64)
iinfo(min=-9223372036854775808, max=9223372036854775807, dtype=int64)
Generate an array of int64 of val> int32.max:
a = np.random.randint(2147483647, 9223372036854775807, size = 3)
array([4841796342900989982, 43877033468085758, 205656391264979944])
: int64
a.dtype
dtype('int64')
numpy.randint ( , , python randint)