By Hemanta Sundaray on 2021-08-13
Let's read the budget.xlsx workbook into a DataFrame:
import pandas as pd
data = pd.read_excel("budget.xlsx")
data
Output:
data["Zone"].str.upper()
Output:
data["Store Code"].str.lower()
Output:
data["City"].str.title()
Output:
data["City"].str.len()
We will replace the character D in all the elements in the Store Code column with the character D.
data["Store Code"].str.replace("Z", "D")
Output: