I have a uint64 column in my DataFrame, but when I convert that DataFrame to a list of python dict using DataFrame.to_dict('record'), what's previously a uint64 gets magically converted to float:
In [24]: mid['bd_id'].head()
Out[24]:
0 0
1 6957860914294
2 7219009614965
3 7602051814214
4 7916807114255
Name: bd_id, dtype: uint64
In [25]: mid.to_dict('record')[2]['bd_id']
Out[25]: 7219009614965.0
In [26]: bd = mid['bd_id']
In [27]: bd.head().to_dict()
Out[27]: {0: 0, 1: 6957860914294, 2: 7219009614965, 3: 7602051814214, 4: 7916807114255}
How can I avoid this strange behavior?
update
strangely enough, if I use to_dict() instead of to_dict('records'), the bd_id column will be of type int:
In [43]: mid.to_dict()['bd_id']
Out[43]:
{0: 0,
1: 6957860914294,
2: 7219009614965,
...