text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

df = pd.read_csv('../input/predict-test-scores-of-students/test_scores.csv')
df

plt.style.use('ggplot')
fig, axes = plt.subplots(nrows=2)
ax1 = df.pretest.plot.kde(figsize=(16,10), ax=axes[0])
ax1 = df.posttest.plot.kde(ax=axes[0])
ax1.legend(['Pretest', 'Posttest'])
ax1.set_title('Density plot of pre/post test scores')
ax2 = df.n_student.plot.kde(ax=axes[1])
ax2.set_title('Density plot of number of students in class')
plt.tight_layout()
plt.show()

fig, axes = plt.subplots(figsize=(16, 7))
ax1 = df.school.value_counts()[::-1].plot(kind='bar', ax=axes)
ax1.set_title('School distribution')
fig, axes = plt.subplots(ncols=2, figsize=(16, 5))
ax2 = df.school_setting.value_counts().plot(kind='bar', ax=axes[0])
ax3 = df.school_type.value_counts().plot(kind='bar', ax=axes[1])
ax2.set_title('School setting')
ax3.set_title('School type')
plt.tight_layout()