Descriptive Statistics with Interview
Answers & Python Examples
1. Mean (Average)
Mean is the average of all values. Use it when data is symmetric without outliers.
Python Example:
import numpy as np
data = [30000, 35000, 38000, 40000, 5000000]
mean_value = np.mean(data)
print("Mean:", mean_value)
2. Median
Median is the middle value. Use it when data is skewed or has outliers.
Python Example:
median_value = np.median(data)
print("Median:", median_value)
3. Standard Deviation
Standard deviation shows how spread out the values are from the mean.
Python Example:
std_value = np.std(data)
print("Standard Deviation:", std_value)
4. Min and Max
Minimum and maximum help in identifying range and outliers.
Python Example:
min_val = np.min(data)
max_val = np.max(data)
print("Min:", min_val, "Max:", max_val)
5. Count
Count tells how many non-null entries exist in the dataset.
Python Example:
import pandas as pd
df = pd.DataFrame({"values": data})
print("Count:", df['values'].count())
6. Skewness
Skewness indicates the asymmetry of the data distribution.
Python Example:
print("Skewness:", df['values'].skew())
7. Kurtosis
Kurtosis tells how heavy the tails of a distribution are.
Python Example:
print("Kurtosis:", df['values'].kurt())