plot_2.py
python_old/plot_2.py
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
# 1. Generate a list of 500 random integers between 1 and 100
random_numbers = np.random.randint(1, 101, 500)
# 2. Use Pandas to create a DataFrame
df = pd.DataFrame(random_numbers, columns=['Random Numbers'])
# 3. Create a histogram using Seaborn
sns.histplot(data=df, x='Random Numbers', bins=20, kde=True)
plt.title("Distribution of Random Numbers")
plt.xlabel("Random Numbers")
plt.ylabel("Frequency")
# 4. Display the plot
plt.show()
Related articles
01_classical_caesar_cipher.py
01_classical_caesar_cipher.py — python source code from the python old learning materials (python_old/Cryptography/01_classical_caesar_cipher.py).
Read article →02_classical_monoalphabetic.py
02_classical_monoalphabetic.py — python source code from the python old learning materials (python_old/Cryptography/02_classical_monoalphabetic.py).
Read article →03_classical_rail_fence.py
03_classical_rail_fence.py — python source code from the python old learning materials (python_old/Cryptography/03_classical_rail_fence.py).
Read article →04_frequency_analysis.py
04_frequency_analysis.py — python source code from the python old learning materials (python_old/Cryptography/04_frequency_analysis.py).
Read article →05_cryptographic_hashing.py
05_cryptographic_hashing.py — python source code from the python old learning materials (python_old/Cryptography/05_cryptographic_hashing.py).
Read article →06_password_hashing.py
06_password_hashing.py — python source code from the python old learning materials (python_old/Cryptography/06_password_hashing.py).
Read article →