Reputation: 71
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
Reputation: 477180
The where=…
parameter has been added since numpy-1.17, so you should upgrade the numpy package, for example with:
pip3 install numpy --upgrade
Upvotes: 1