chevron_left
Properties
0
0
0
new
Pandas DataFrame | shape property
Programming
chevron_rightPython
chevron_rightPandas
chevron_rightDocumentation
chevron_rightDataFrame
chevron_rightProperties
schedule Mar 10, 2022
Last updated Python●Pandas
Tags tocTable of Contents
expand_more Pandas DataFrame.shape
property returns the number of rows and columns in the DataFrame as a tuple.
Examples
Consider the following DataFrame:
df
A B C0 4 6 81 5 7 9
Here's its shape
property:
df.shape
(2, 3)
This means that our DataFrame has 2
rows and 3
columns.
To access the individual values, simply use [~]
as you would for any tuple:
Published by Isshin Inada
Edited by 0 others
Did you find this page useful?
Ask a question or leave a feedback...
Official Pandas Documentation
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.shape.html