The main behavior is that it tries to connect the values with the same label. If no label is found, assigned NaN. If the label is not unique left or right (but not at the same time), it exhausts all the possibilities. For instance,
pd.Series((2,3), ("a","b")) * pd.Series((5,7), ("b","b"))
returns:
a NaN
b 15.0
b 21.0
and
pd.Series((2,3), ("b","b")) * pd.Series((5,7), ("a","b"))
returns
a NaN
b 14.0
b 21.0
But if the label is not unique left and right, for example,
pd.Series((2,3), ("b","b")) * pd.Series((5,7), ("b","b"))
You get
b 10
b 21
I would prefer that this exhausts all the possibilities, i.e. to return
b 10
b 14
b 15
b 21
What defines a subset of return values? Is this based on line order? If so, what is the reason for this behavior?
Thank you
source
share