Pandas Describe
# Pandas Descriptive Statistics
Descriptive statistics are used to summarize and describe the basic characteristics of data. Pandas provides a rich set of statistical functions that can quickly obtain overall distribution information of the data.
* * *
## Basic Statistical Functions
## Example
```python
import pandas as pd
import numpy as np
# Create sample data
df = pd.DataFrame({
"Age": [25,30,28,35,22,40,38,45,29,31],
"Salary": [12000,15000,11000,18000,9000,20000,17000,22000,12500,14000],
"Performance": [85,92,78,88,65,95,82,90,75,89]
})
print("=== Data Overview ===")
print(f"Data shape: {df.shape}")
print(f"nBasic Statistics:")
print(df.describe())
### Common Statistical Measures
| Function | Description | Example |
| --- | --- | --- |
| `count()` | Number of non-null values | `df.count()` |
| `sum()` | Sum | `df.sum()` |
| `mean()` | Mean | `df.mean()` |
| `median()` | Median | `df.median()` |
| `std()` | Standard deviation | `df.std()` |
| `var()` | Variance | `df.var()` |
| `min() / max()` | Minimum / Maximum value | `df.min()` |
| `quantile()` | Quantile | `df.quantile(0.5)` |
Note: The rest of the content appears to be cut off in the original Chinese text. The table continues with more statistical functions but is not fully visible in the provided excerpt.
YouTip