Skip to content

Commit

Permalink
Change series accessor due to pandas warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitakuklev committed Nov 30, 2023
1 parent 8dba73f commit dce55e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pysdds/structures/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,11 @@ def from_df(df_list: List[pd.DataFrame],
columns = df.columns

for i, c in enumerate(columns):
if df.dtypes[i] == np.dtype(np.int64):
if df.dtypes.iloc[i] == np.dtype(np.int64):
val = df.iloc[:, i].values # .astype(np.int32)
else:
val = df.iloc[:, i].values
sdds_type = constants._NUMPY_DTYPES_INV[df.dtypes[i]]
sdds_type = constants._NUMPY_DTYPES_INV[df.dtypes.iloc[i]]
namelist = {'name': c, 'type': sdds_type}
col = Column(namelist, sdds)
sdds.columns.append(col)
Expand All @@ -995,7 +995,7 @@ def from_df(df_list: List[pd.DataFrame],
if not np.array_equal(columns, df.columns):
raise ValueError(f'Dataframe columns not same - {columns} vs {df.columns}')
for i, c in enumerate(columns):
if df.dtypes[i] == np.dtype(np.int64):
if df.dtypes.iloc[i] == np.dtype(np.int64):
val = df.iloc[:, i].to_numpy(np.int32)
else:
val = df.iloc[:, i].to_numpy()
Expand Down

0 comments on commit dce55e8

Please sign in to comment.