Pandas DataFrame property: T
DataFrame - T property
The T property is used to transpose index and columns.
Reflect the DataFrame over its main diagonal by writing rows as columns and vice-versa. The property T is an accessor to the method transpose().
Syntax:
DataFrame.T
Parameters:
Name | Description | Type/Default Value | Required / Optional |
---|---|---|---|
copy | If True, the underlying data is copied. Otherwise (default), no copy is made if possible. | bool Default Value: False |
Required |
*args, **kwargs | Additional keywords have no effect but might be accepted for compatibility with numpy. | Required |
Returns: DataFrame
The transposed DataFrame.
Example:
Download the Pandas DataFrame Notebooks from here.
Previous: DataFrame - squeeze() function
Next: DataFrame - transpose() function
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework