I ran up against unexpected behavior in pandas when comparing two series. I wanted to know if this is intended or a bug.
suppose I:
import pandas as
Bug or not. I would suggest to make a dataframe and compare the series inside the dataframe.
import pandas as pd
x = pd.Series([1, 1, 1, 0, 0, 0], index=['a', 'b', 'c', 'd', 'e', 'f'], name='Value_x')
y = pd.Series([0, 2, 0, 2, 0, 2], index=['c', 'f', 'a', 'e', 'b', 'd'], name='Value_y')
df = pd.DataFrame({"Value_x":x, "Value_y":y})
df['Value_x'] > df['Value_y']
Out[3]:
a True
b True
c True
d False
e False
f False
dtype: bool