plot.py
python_old/plot.py
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Load the CSV - df - dataframe
df = pd.read_csv("./student_scores.csv") # df - dataframe
print(df.head(10))
# Set seaborn style
sns.set(style="whitegrid")
# Boxplot
plt.figure(figsize=(10, 6))
sns.boxplot(data=df[['Math', 'Science', 'English']])
plt.title("Boxplot of Scores by Subject")
plt.ylabel("Score")
plt.show()
# Histogram
plt.figure(figsize=(8, 5))
sns.histplot(df['Math'], bins=8, kde=True)
plt.title("Distribution of Math Scores")
plt.xlabel("Math Score")
plt.ylabel("Frequency")
plt.show()
# Scatter plot
plt.figure(figsize=(8, 5))
sns.scatterplot(data=df, x='Math', y='Science', hue='Gender', style='Gender', s=100)
plt.title("Math vs Science Scores by Gender")
plt.xlabel("Math Score")
plt.ylabel("Science Score")
plt.show()
관련 글
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).
글 읽기 →02_classical_monoalphabetic.py
02_classical_monoalphabetic.py — python source code from the python old learning materials (python_old/Cryptography/02_classical_monoalphabetic.py).
글 읽기 →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).
글 읽기 →04_frequency_analysis.py
04_frequency_analysis.py — python source code from the python old learning materials (python_old/Cryptography/04_frequency_analysis.py).
글 읽기 →05_cryptographic_hashing.py
05_cryptographic_hashing.py — python source code from the python old learning materials (python_old/Cryptography/05_cryptographic_hashing.py).
글 읽기 →06_password_hashing.py
06_password_hashing.py — python source code from the python old learning materials (python_old/Cryptography/06_password_hashing.py).
글 읽기 →