Bastien.mva
Bastien.mva

Reputation: 71

sum() got an unexpected keyword argument 'where'

I am trying to sum a vector with bool condition with np.sum().

it works on google colab but not on local. Here is my line of code :

np.sum([[0, 1], [np.nan, 5]], where=[False, True], axis=1)

Can anyone help me?

Upvotes: 0

Views: 1676

Answers (1)

willeM_ Van Onsem
willeM_ Van Onsem

Reputation: 477180

The where=… parameter has been added since , so you should upgrade the numpy package, for example with:

pip3 install numpy --upgrade

Upvotes: 1

Related Questions