Skip to content

Glossary: pandas Beyond the Basics

str.replace

Also written: .str.replace(), regex=True

A `.str` method that rewrites text. With `regex=True` the first argument is a pattern, so `r"\?.*$"` deletes everything from the `?` to the end.

Where the book teaches it

Related terms

Regular expression (regex)extract