Temp O'rary
Temp O'rary

Reputation: 5828

How can we parse DataFrame.describe()?

How can we parse the output from DataFrame.describe()? When we print the result of DataFrame.describe() as shown in examples, it is in string format, which is why it is difficult to parse it.

I understand that the print function might be converting the output into a displayable and readable form. However, it is not easily parseable. How can we achieve this?

Upvotes: 0

Views: 339

Answers (2)

kevh
kevh

Reputation: 323

the output of describe() is a dataframe so you can do:

df = x.describe()

df is a standard DataFrame

Upvotes: 0

panktijk
panktijk

Reputation: 1614

print always prints in string format.

But if you check type(df.describe()) then you'll see that it is a dataframe. So you can treat it like one. :)

Upvotes: 1

Related Questions