在Windows Server 2012上如何处理“ OverflowError:Python int太大而无法转换为C long”错误,如何获得转换?

在Anaconda Python 2.7.12,Pandas 18.1,Windows Server 2012上运行时:
df['z'] = df['y'].str.replace(' ', '').astype(int)
我收到此错误:
OverflowError: Python int too large to convert to C long
我在MacOS 10.11或Ubuntu 14.04上没有收到此错误.我从其他地方了解到,Windows C编译器对long的定义不同于类似Unix的OS.如果是这样,我该如何在Windows上进行这项工作?
此外,data.txt的大小仅为172 KB.如果有帮助,data.txt将采用以下形式:
x|y
99999917|099999927 9991
99999911|999999979 9994
99999912|999999902 9992
解决方法:
numpy将int解释为np.int_ dtype,它对应于C整数.在Windows上,即使在64位系统上,这也是32位整数.
因此,如果需要转换较大的值,请使用
.astype('int64')