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



Follow us on Facebook and Twitter for latest update.