'pd.where() gives TypeError: where() got multiple values for argument 'other' when there is only on value

I've read the docs,

(https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.where.html)

When I use the below, all is fine and the code works perfectly:

df['c06new']='not_women_gathered'
df[c06new].where(f1 & f2,"women_gathered",inplace=True)
(df[c06new]=='women_gathered').sum()

However, if I use,

df.where(f1 & f2,"women_gathered", other='not',inplace=True)

I get: TypeError: where() got multiple values for argument 'other'

Why is this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source