Way to show multiple spaces in Pandas Dataframe on Jupyter Notebook

Viewed 413

When displaying Pandas Dataframe object on notebook, multiple spaces are shown as single space. And I cannot copy multiple spaces.

I would like to show all spaces as they are and copy a string of them.

Any way to do so?

display(pd.DataFrame([["ab c", "ab  c"], ["ab   c", "ab    c"]]))

Actual

    0     1   
0   ab c  ab c
1   ab c  ab c

My expectation

    0       1     
0   ab c    ab  c
1   ab   c  ab    c
1 Answers
Related