Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
630 B
1
Indexable
Never
import numpy as np

# Sample data
data = np.array([12, 15, 18, 20, 22, 25, 28, 30, 32, 35])

# Range
data_range = np.max(data) - np.min(data)

# Variance
variance = np.var(data)

# Standard deviation
std_deviation = np.std(data)

# Interquartile range (IQR)
quartiles = np.percentile(data, [25, 75])
iqr = quartiles[1] - quartiles[0]

# Coefficient of variation (CV)
mean = np.mean(data)
cv = (std_deviation / mean) * 100

print("Data:", data)
print("Range:", data_range)
print("Variance:", variance)
print("Standard Deviation:", std_deviation)
print("Interquartile Range (IQR):", iqr)
print("Coefficient of Variation (CV):", cv)
Leave a Comment