July 2019
Beginner to intermediate
740 pages
16h 52m
English
So far, we've examined the structure of the DataFrame object we created from the earthquake data, but we don't know anything about the data. Pandas provides several methods for easily getting summary statistics and getting to know our data better. Now that we know what our data looks like, the next step is to get summary statistics with the describe() method:
>>> df.describe()
We get the 5-number summary along with the count, mean, and standard deviation of the numeric columns:
| cdi | dmin | felt | gap | mag | ... | |
|---|---|---|---|---|---|---|
| count | 329.000000 | 6139.000000 | 329.000000 | 6164.000000 | 9331.000000 | ... |
| mean | 2.754711 | 0.544925 | 12.310030 | 121.506588 | 1.497345 | ... |
| std | 1.010637 | 2.214305 | 48.954944 | 72.962363 | 1.203347 | ... |
| min | 0.000000 ... |
Read now
Unlock full access