Descriptive statistics involves summarizing and presenting data in a meaningful way to describe its main features, such as measures of central tendency (mean, median, mode) and measures of dispersion (standard deviation, range). Inferential statistics, on the other hand, uses data from a sample to make inferences or predictions about a larger population.
Example Code (Descriptive Statistics):
import numpy as np
data = [12, 18, 21, 15, 24, 30, 16, 20]
mean = np.mean(data)
median = np.median(data)
std_dev = np.std(data)
print("Mean:", mean)
print("Median:", median)
print("Standard Deviation:", std_dev)