I have a numpy array of floats of arbitrary precision (dtype=object). How do I convert this array of floats with arbitrary precision to array of integers? a = np.array([10662878767676765765756765768768787987, 1068768988765462575276572656879287982,..], dtype= object) b = a*821627.1218279279222972 a = b.astype(int) How do I round off b to get back array of integers without losing precision?
np.astype gives me the following error:
Overflowerror: Python int too large to convert to C long.
Thanks much for the help!