问题
qihuo['CONTRACTNAME'] = qihuo['CONTRACTNAME'].astype(int)
pandas:OverflowError: Python int too large to convert to C long
解决方法
import numpy as np
qihuo['CONTRACTNAME'] = qihuo['CONTRACTNAME'].astype(np.int64)
原因
int , System.Int16 , System.Int32和System.Int64与它们的大小之间的区别
Int16 :2个字节,16位
Int32和int :4个字节,32位
Int64 :8个字节,64位