I would like to know if I can use native types for number in a pandas DataFrame instead of numpy types.
I try to convert from numpy to native int with this code:
# Convert numpy to native type
df['a'] = df['a'].astype(int)
for index, row in df.iterrows():
# If this is a numpy type then it has an item method
if hasattr(df['a'][index], 'item'):
df['a'][index] = df['a'][index].item()
But when I check the type, it is always a numpy.int64