Skip to content

BUG: Index string ops ignores the order #10083

Closed
@sinhrks

Description

@sinhrks

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')

Metadata

Metadata

Assignees

No one assigned

    Labels

    StringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions