Skip to content

Conversation

jorisvandenbossche
Copy link
Member

For strings in object dtype, we escape \n, \t, \r characters in the series/dataframe repr. Doing the same here for the string dtype.

xref #54792

@jorisvandenbossche jorisvandenbossche added Output-Formatting __repr__ of pandas objects, to_string Strings String extension data type and string data labels Nov 6, 2024
@jorisvandenbossche jorisvandenbossche added this to the 2.3 milestone Nov 6, 2024
@mroeschke mroeschke merged commit 5929ae9 into pandas-dev:main Nov 6, 2024
51 checks passed
@mroeschke
Copy link
Member

Thanks @jorisvandenbossche

meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Nov 6, 2024
@jorisvandenbossche jorisvandenbossche deleted the string-dtype-repr-escaping branch November 6, 2024 20:22
mroeschke pushed a commit that referenced this pull request Nov 6, 2024
…of newline/tab characters in the repr) (#60220)

Backport PR #60215: BUG (string dtype): fix escaping of newline/tab characters in the repr

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Output-Formatting __repr__ of pandas objects, to_string Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants