Skip to content

Commit

Permalink
try again with x is pd.NA
Browse files Browse the repository at this point in the history
  • Loading branch information
BSalita committed Feb 13, 2024
1 parent 951cc5f commit 34ba22b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chatlib/chatlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def clean_validate_df(df):
if df['Tricks'].isna().any():
print_to_log_info('NaN Tricks:\n',df[df['Tricks'].isna()][['Board','Contract','BidLvl','BidSuit','Dbl','Declarer_Direction','Score_NS','Score_EW','Tricks','Result','scores_l']])
df['Tricks'] = df['Tricks'].astype('UInt8')
assert df['Tricks'].map(lambda x: (x != x) or (x is pd.NA) or (0 <= x <= 13)).all() # hmmm, x != x is the only thing which works? pandas regression? x is None and x is pd.NA does not work.
assert df['Tricks'].map(lambda x: (x is pd.NA) or (0 <= x <= 13)).all() # hmmm, x != x is the only thing which works? pandas regression? x is None and x is pd.NA does not work.

df['Round'].fillna(0,inplace=True) # player numbers are sometimes missing. fill with 0.

Expand Down

0 comments on commit 34ba22b

Please sign in to comment.