Add "df.describe()" (#24664)

This commit is contained in:
sophiekamuf
2018-12-18 02:52:01 +01:00
committed by Christopher McCormack
parent f5dff52e3f
commit a7fd4e4219

View File

@ -45,6 +45,12 @@ df.tail()
``` ```
This will show the last 5 rows of the data frame. This will show the last 5 rows of the data frame.
To show descriptive statistics, such as the shape and central tendency of the dataset, the `describe` method can be used:
```python
df.describe()
```
This will show the `count`, `mean`, `std`, `min`, `max` among others for numeric data.
## Subsetting ## Subsetting
A data frame can be subset in many ways. One of the simplest is getting a single column. For instance, if the data frame `df` contains a column named `age`, we can extract it as follows: A data frame can be subset in many ways. One of the simplest is getting a single column. For instance, if the data frame `df` contains a column named `age`, we can extract it as follows:
```python ```python