How can we access the elements of df.describe() for any DataFrame df?

pandas
ipython
python

#1

Hello,

I am using pandas for data exploratory purposes and can see some parameters for a DataFrame using df.describe.

I want to access some of the information from the outcome of this command. For example, I was to use mean (displayed in row 1 in the output).

How can we access it?

Thanks


#2

You can store the result of df.describe in a new dataframe df1 as:
Df1 = pd.DataFrame(df.describe())
Then store the columns in the forms of series :
F= pd.Series(Df1[‘PassengerId’])
Where ‘PassengerId’ is a column of the dataframe Df1 And access the datapoints as
F[0],F[1],F[2]…….

Hope this helps.

Thanks