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



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/pandas/series/series-str-casefold.php