Search⌘ K

Other Manipulation Methods

Explore pandas Series manipulation methods such as clipping data to limit outliers and sorting values or indices. Understand how to apply these techniques to clean and organize data effectively within pandas.

Clipping data

If we have outliers in our data, we might want to use the clip method. In the example below, we’ll see the original first 447 entries in the “city” range from 9 to 31:

Python 3.8
print(city_mpg.loc[:446])

We can replace the values of the above series to be between ...