Skip to content

BUG: Series/Dataframe has bad repr for Right-To-Left (RTL) data #7411

Open
@David-Alkalai

Description

@David-Alkalai

This code

df=pd.DataFrame([['שלום','עליכם', 'מלאכי השלום', 'ברוכים הבאים']])
df.columns=['A','B','C','D']
df

does this:

pd1

See that the data row is close to the right?

Half a workaround is to prepend the unicode LTR character to each row:

print u"\n\u200e".join(unicode(df).split("\n"))

bidi

but if you look you can see the data appears in reverse order, since:

In [49]: print df.iloc[0,0]
שלום

The same occurs even if the text is decoded into unicode strings.

I tried to understand the repr code in pandas but it's too complex
for me to follow, full of special cases. I hope the developers can fix this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions