w3resource

Pandas Series: str.casefold() function

Series-str.casefold() function

The str.casefold() function is used to convert strings in the Series/Index to be casefolded.

The method is equivalent to str.casefold().

Syntax:

Series.str.casefold(self)
Pandas Series: str.casefold() function

Returns: Series/Index of objects

Example:

Python-Pandas Code:

import pandas as pd
s = pd.Series(['flower', 'CAPTAIN', 'this is my pen', 'FoOtBaLl'])
s.str.casefold()

Output:

0            flower
1           captain
2    this is my pen
3          football
dtype: object

Previous: Series-str.capitalize() function
Next: Series-str.cat() function



Follow us on Facebook and Twitter for latest update.