Replacing Characters in a String

Learn how to use the replace function in Pandas.

We'll cover the following

The replace function

The Pandas library provides highly flexible ways to manipulate strings. One of them is the replace function, under the str accessor. It can be used to replace a character or a sequence of characters in a string.

For instance, line 5 in the following code snippet replaces the , in the city column with -.

Get hands-on with 1400+ tech skills courses.