test = pd.Series({True: 0, False: 0})
1.4.4
print(test[0])
> 0
but
1.5.0
print(test[True])
> keyerror 0
1.4.4 and 1.5.0 What has changed?I can't find it
test = pd.Series({True: 0, False: 0})
1.4.4
print(test[0])
> 0
but
1.5.0
print(test[True])
> keyerror 0
1.4.4 and 1.5.0 What has changed?I can't find it
test[0] is inherently unclear, and it looks like the updated version of pandas refuses to guess from your ambiguity.
By doing test[0] on a Series with a bool type index, you could mean:
test.iloc[0], which is silly, but you should do this explicitly if it's your intention.test[False] ... remember 0 == False is True.
test[bool(0)]The keyerror is correct though, there is no 0 in Index([True, False], dtype='bool')