Here's a simple DataFrame example:
import pandas as pd
d = dict(
column1 = [1, 'a', 'foo'],
column2 = [2, 'b', 'bar'],
column3 = [3, 'c', 'baz'],
)
df = pd.DataFrame(data=d)
print(df)
with the output
column1 column2 column3
0 1 2 3
1 a b c
2 foo bar baz
I want to transpose it and rename the columns:
df.do_some_manipulation('numbers', 'letters', 'words')
so the output would be
numbers letters words
0 1 a foo
1 2 b bar
2 3 c baz
Transpose method is not quite the thing, what should I do then?