Question:medium

__________ gives the transpose of a DataFrame.

Show Hint

In Pandas, ".T" is a quick attribute, while ".transpose()" is a full method.
Both perform the exact same mathematical transposition of axes.
Updated On: Jun 11, 2026
  • DataFrame.TP
  • DataFrame.Trans
  • DataFrame.T
  • DataFrame.Transpose
Show Solution

The Correct Option is C

Solution and Explanation


Step 1: Understanding the Question:

The question asks for the specific attribute in Pandas that is used to get the transpose of a DataFrame (swapping rows and columns).

Step 2: Key Formula or Approach:

In linear algebra and data analysis, transposing a matrix or data table swaps its rows with its columns.
In Pandas, the transpose of a DataFrame can be accessed using the property .T or the method .transpose().

Step 3: Detailed Explanation:

Let's analyze the properties of a Pandas DataFrame:
- df.T is an accessor property that transposes the index and columns of the DataFrame.
- It is equivalent to calling df.transpose(), but the attribute .T is much more common and concise.
Let's evaluate the options:
- DataFrame.TP is invalid.
- DataFrame.Trans is invalid.
- DataFrame.T is the correct attribute.
- DataFrame.Transpose starts with an uppercase 'T', which is incorrect (it should be lowercase transpose() as a function call with parentheses). Thus, the exact attribute match is DataFrame.T.
Therefore, option (C) is the correct answer.

Step 4: Final Answer:

The correct option is (C).
Was this answer helpful?
0


Questions Asked in CUET (UG) exam