pd.Series([np.array(True), np.array(True)]).mean() == 0.5

#python #numpy #wat

Follow

@jerub This is an interesting one. Why is it doing that?

@pganssle it seems to be treating the sum of True as True, and True/2 is 0.5.

You can change the dtype to get a more normal looking answer.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.