PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import matplotlib.pyplot as plt
import numpy as np
#A data distribution represents the spread or pattern of data points in a dataset.
#Understanding data distribution is crucial for selecting appropriate data analysis techniques
# key characteristics :
#outlier detection
#choosing appropriate statistical tests
#making informed decisions in data-driven contexts.
#→ Normal Distribution : A normal distribution is a type of probability distribution where the data tends to be clustered around the mean
normal_data = np.random.normal(size=1000)
plt.figure(figsize=(10,6))
plt.hist(normal_data, bins=30, density=True, alpha=0.7)
plt.title('Normal Distribution')
plt.savefig('normal_distribution.png')
plt.show()
#→ Right-skewed Distribution : A right-skewed distribution, also known as a positive-skewed distribution, is a type of distribution where the tail on the right side is longer
right_skewed_data = np.random.exponential(size=1000)
plt.figure(figsize=(10,6))
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run