how to turn columns into rows in pandas code example

Example 1: python how to add columns to a pandas dataframe

# Basic syntax:
pandas_dataframe['new_column_name'] = ['list', 'of', 'column', 'values']

# Note, the list of column values must have length equal to the number
# 	of rows in the pandas dataframe you are adding it to.

# Add column in which all rows will be value:
pandas_dataframe['new_column_name'] = value
# Where value can be a string, an int, a float, and etc

Example 2: dataframe index column invert

You're looking for the transpose (T) method

In [11]: df
Out[11]:
         10  20  30  70
data1:  2.3   5   6   7

In [12]: df.T
Out[12]:
    data1:
10     2.3
20     5.0
30     6.0
70     7.0

Example 3: dataframe index column invert

In [11]: df
Out[11]:
         10  20  30  70
data1:  2.3   5   6   7

In [12]: df.T
Out[12]:
    data1:
10     2.3
20     5.0
30     6.0
70     7.0