diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 46f8c73027f48..f6994b6912e29 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3569,6 +3569,31 @@ def transpose(self, *args, copy: bool = False) -> DataFrame: @property def T(self) -> DataFrame: + """ + The transpose of the DataFrame. + + 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 + """ return self.transpose() # ----------------------------------------------------------------------