@@ -119,7 +119,11 @@ def from_pandas_df(self, pandas_df):
119119 if not isinstance (pandas_df , pd .DataFrame ):
120120 raise TypeError ("pandas_df must be pd.DataFrame" )
121121
122- self .orig_dtypes = dict (pandas_df .dtypes )
122+ dtypes = dict (pandas_df .dtypes )
123+ for row , dtype in dtypes .items ():
124+ if np .issubdtype (dtype ,int ):
125+ dtype = np .int64
126+ self .orig_dtypes [row ] = dtype
123127
124128 if pandas_df .columns .dtype != object :
125129 # default headers are Int64 type, but for the NavData
@@ -969,7 +973,10 @@ def __setitem__(self, key_idx, new_value):
969973 # Adding numeric values
970974 self .str_map [key_idx ] = {}
971975 # update original dtype in case of replacing values
972- self .orig_dtypes [key_idx ] = np .asarray (new_value ).dtype
976+ dtype = np .asarray (new_value ).dtype
977+ if np .issubdtype (dtype , int ):
978+ dtype = np .int64
979+ self .orig_dtypes [key_idx ] = dtype
973980 if self .array .shape == (0 ,0 ):
974981 # if empty array, start from scratch
975982 self .array = np .reshape (new_value , (1 ,- 1 ))
@@ -1012,7 +1019,10 @@ def __setitem__(self, key_idx, new_value):
10121019 self .array [rows , cols ] = new_value
10131020 # update original dtype in case of replacing values
10141021 for row_index in rows :
1015- self .orig_dtypes [self .inv_map [row_index ]] = np .asarray (new_value ).dtype
1022+ dtype = np .asarray (new_value ).dtype
1023+ if np .issubdtype (dtype , int ):
1024+ dtype = np .int64
1025+ self .orig_dtypes [self .inv_map [row_index ]] = dtype
10161026
10171027 def __iter__ (self ):
10181028 """Initialize iterator over NavData (iterates over all columns)
0 commit comments