In [1]:
import numpy as np
import time

In [2]:
count = 1573457319

In [3]:
start = time.time()
indexes = np.arange(1,count+1,dtype = np.int32)
ri = np.random.choice(indexes,size = count, replace=False)
end = time.time()
print('generation took %.1f minutes' %((end-start)/60))


generation took 7.9 minutes

In [4]:
max(ri)


Out[4]:
1573457319

In [12]:
np.save('random_index.npy',ri)

In [ ]: