In [1]:
import numpy as np
import pandas as pd
from pandas import Series, DataFrame

In [2]:
dframe = DataFrame(np.arange(12).reshape(3,4), index=['NY', 'LA', 'SF'], columns = list('ABCD'))

In [3]:
dframe


Out[3]:
A B C D
NY 0 1 2 3
LA 4 5 6 7
SF 8 9 10 11

In [4]:
dframe.index.map(str.lower)


Out[4]:
array(['ny', 'la', 'sf'], dtype=object)

In [5]:
dframe.index = dframe.index.map(str.lower)

In [6]:
dframe.rename(index = str.title, columns = str.lower)


Out[6]:
a b c d
Ny 0 1 2 3
La 4 5 6 7
Sf 8 9 10 11

In [7]:
dframe


Out[7]:
A B C D
ny 0 1 2 3
la 4 5 6 7
sf 8 9 10 11

In [8]:
dframe.rename(index={'ny': 'NEW YORK'}, columns={'A': 'ALPHA'})


Out[8]:
ALPHA B C D
NEW YORK 0 1 2 3
la 4 5 6 7
sf 8 9 10 11

In [10]:
dframe.rename(index={'ny': 'NEW YORK'}, columns={'A': 'ALPHA'}, inplace=True)

In [11]:
dframe


Out[11]:
ALPHA B C D
NEW YORK 0 1 2 3
la 4 5 6 7
sf 8 9 10 11

In [ ]: