BUG: Index string ops ignores the order · Issue #10083 · pandas-dev/pandas (original) (raw)
Series (OK)
s = pd.Series(['A', 'B'])
'x' + s
#0 xA
#1 xB
# dtype: object
s + 'y'
#0 Ay
#1 By
# dtype: object
Index (NG)
idx = pd.Index(['A', 'B'])
# NG
'x' + idx
# Index([u'Ax', u'Bx'], dtype='object')
# OK
idx + 'y'
# Index([u'Ay', u'By'], dtype='object')