DataFrame.transpose()
Pandas DataFrame.transpose()
transpose the index and columns of the info frame. It reflects the DataFrame along its main diagonal, writing rows as columns and vice versa.
Syntax: DataFrame.transpose (* args, ** kwargs)
Parameter:
copy: If True, the underlying data is copied. Otherwise (default), no copy is made if possible.
* args, ** kwargs: Additional keywords have no effect but might be accepted for compatibility with numpy.Returns: The transposed DataFrame
Example # 1: Use DataFrame.transpose ()
to find transpose this data frame.
|
Exit:
We will now use DataFrame.transpose ()
to find the transposition of this dataframe.
|
Output:
As we can see in the output, DataFrame.transpose ()
successfully returned the transpose of the given data frame.
Example # 2: Use DataFrame.transpose ()
to find the transponder coding this data frame.
|
Exit:
Now we will use DataFrame.transpose ()
to find the transposition of the given data frame.
|
Output:
As we can see in the output, DataFrame.transpose ()
returned successfully transpose this data frame.