Skip to content

possible error in documentation #26865

Closed
@karpanGit

Description

@karpanGit

The page

https://pandas.pydata.org/pandas-docs/stable/user_guide/missing_data.html#string-regular-expression-replacement

seems to have an example that can be improved. The page lists

df.replace([r'\.', r'(a)'], ['dot', '\1stuff'], regex=True)

as an example. However '\1' is ignored because the replacement regex is not a raw string. I think what you mean is likely

df.replace([r'\.', r'(a)'], ['dot', r'\1stuff'], regex=True)

if my understanding is correct please consider updating the page.

Regards,

Panos Karamertzanis

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions