you can use index
and columns
attributes of pandas.DataFrame
. NOTE: number of elements of list must match the number of rows/columns.
# A B C
# ONE 11 12 13
# TWO 21 22 23
# THREE 31 32 33
df.index = [1, 2, 3]
df.columns = ['a', 'b', 'c']
print(df)
# a b c
# 1 11 12 13
# 2 21 22 23
# 3 31 32 33