Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python - Dimension of Data Frame

Tags:

python

pandas

New to Python.

In R, you can get the dimension of a matrix using dim(...). What is the corresponding function in Python Pandas for their data frame?

like image 259
user1911092 Avatar asked Dec 17 '12 20:12

user1911092


People also ask

What is dimension of DataFrame in Python?

Dimensions. A pandas DataFrame has two dimensions: the rows and the columns.

What are dimensions of a DataFrame?

In Python Pandas, the dataframe. size property is used to display the size of Pandas DataFrame . It returns the size of the DataFrame or a series which is equivalent to the total number of elements. If you want to calculate the size of the series , it will return the number of rows.

How do you determine the shape of a data frame?

To get the shape of Pandas DataFrame, use DataFrame. shape. The shape property returns a tuple representing the dimensionality of the DataFrame. The format of shape would be (rows, columns).


1 Answers

df.shape, where df is your DataFrame.

like image 102
BrenBarn Avatar answered Sep 22 '22 08:09

BrenBarn