Skip to content

Commit

Permalink
np.NaN deprecated for np.nan
Browse files Browse the repository at this point in the history
Running the tutorial with numpy v2.0 yields an error due to `np.NaN`. Both `np.NaN` and `np.nan` have been used, changed the remaining two NaN to nan.
  • Loading branch information
Zitzeronion authored Aug 5, 2024
1 parent 9f060dd commit 128a53e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyMBE.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,14 +714,14 @@ def copy_df_entry(self, name, column_name, number_of_copies):
else:
df_by_name = df_by_name[df_by_name.index == df_by_name.index.min()]
df_by_name_repeated = pd.concat ([df_by_name]*(number_of_copies), ignore_index=True)
df_by_name_repeated[column_name] =np.NaN
df_by_name_repeated[column_name] =np.nan
# Concatenate the new particle rows to `df`
self.df = pd.concat ([self.df,df_by_name_repeated], ignore_index=True)
else:
if not df_by_name[column_name].isnull().values.any():
df_by_name = df_by_name[df_by_name.index == df_by_name.index.min()]
df_by_name_repeated = pd.concat ([df_by_name]*(number_of_copies), ignore_index=True)
df_by_name_repeated[column_name] =np.NaN
df_by_name_repeated[column_name] =np.nan
self.df = pd.concat ([self.df,df_by_name_repeated], ignore_index=True)
return

Expand Down

0 comments on commit 128a53e

Please sign in to comment.