1

I have the following series

x = pd.Series([1, 2], index=['a', 'b'])
y = pd.Series([1, 2], index=['b', 'a'])

When I try

x < y

I get an error

ValueError: Can only compare identically-labeled Series objects

However, with

x.lt(y)

it produces the corrent result.

The documentation states that they should be equivalent (with the exception of missing values)

Is this a bug in pandas, or am I misunderstanding something?

blue_note
  • 27,712
  • 9
  • 72
  • 90

0 Answers0