import pandas as pd
import numpy as np
import string
df = pd.DataFrame(np.arange(12).reshape(3,4), index = list('abc'), columns = list('wxyz'))
df
w x y z
a 0 1 2 3
b 4 5 6 7
c 8 9 10 11
I know that I can change the index using the map method in this way.
df.index.map(str.upper)
Wondered if I could change the Index in this way.
df.index.map(string.ascii_lowercase)
But, when I ran the code, I got the following error
TypeError: 'str' object is not callable
Can someone explain the syntactical difference and the reason for the error.