I'm trying to insert long integers in a Pandas Dataframe
import numpy as np
from pandas import DataFrame
data_scores = [(6311132704823138710, 273), (2685045978526272070, 23), (8921811264899370420, 45), (17019687244989530680L, 270), (9930107427299601010L, 273)]
dtype = [('uid', 'u8'), ('score', 'u8')]
data = np.zeros((len(data_scores),),dtype=dtype)
data[:] = data_scores
df_crawls = DataFrame(data)
print df_crawls.head()
But when I look in the dataframe, last values which are long are now negative :
uid score 0 6311132704823138710 273 1 2685045978526272070 23 2 8921811264899370420 45 3 -1427056828720020936 270 4 -8516636646409950606 273
uids are 64 bits unsigned int, so 'u8' should be the correct dtype ? Any ideas ?