Skip to main content
`Ctrl`+`K`

# pandas.DataFrame.T

property DataFrame.T

  The transpose of the DataFrame.

  This property returns a DataFrame with rows and columns interchanged, reflecting the data across the main diagonal.

  Returns:
    DataFrame

      The transposed DataFrame.

  See also

  `DataFrame.transpose`

    Transpose index and columns.

  Examples

      >>> df = pd.DataFrame({"col1": [1, 2], "col2": [3, 4]})
      >>> df
         col1  col2
      0     1     3
      1     2     4

      >>> df.T
            0  1
      col1  1  2
      col2  3  4