Skip to content

Commit

Permalink
[fix] replace NaN to [np.nan]
Browse files Browse the repository at this point in the history
  • Loading branch information
micchu committed Oct 9, 2024
1 parent d7e5c18 commit 56e76b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bdpy/fig/makeplots2.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ def __weird_form_to_long(df, target_col, identify_cols=[]):
identify_cols: list of str
A list of columns to keep in the decomposed dataframe, other than target_col.
"""
# replace NaN to [np.nan]
nans = df[target_col].isna()
df[target_col][nans] = [np.nan]
# Weird form
df_result = pd.DataFrame()
for i, row in df.iterrows():
tmp = {}
Expand Down

0 comments on commit 56e76b4

Please sign in to comment.