w3resource

Pandas Series: str.lower() function

Series-str.lower() function

The str.lower() function is used to convert strings in the Series/Index to lowercase.

Syntax:

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

Returns: Series/Index of objects

Example:

Python-Pandas Code:

import numpy as np
import pandas as pd
s = pd.Series(['long', 'CAPTAIN', 'this is my car', 'FoOtBaLl'])
s

Output:

0              long
1           CAPTAIN
2    this is my car
3          FoOtBaLl
dtype: object

Python-Pandas Code:

import numpy as np
import pandas as pd
s = pd.Series(['long', 'CAPTAIN', 'this is my car', 'FoOtBaLl'])
s.str.lower()

Output:

0              long
1           captain
2    this is my car
3          football
dtype: object

Previous: Series-str.len() function
Next: Series-str.lstrip() 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://w3resource.com/pandas/series/series-str-lower.php