import pandas as pd
import csv
import plotly_express as px

df = pd.read_csv('data.csv')

m = df.groupby(['student_id', 'level'], as_index = False)['attempt'].mean()

fig = px.scatter(m, x = 'student_id', y = 'level', size='attempt', color = 'attempt')
fig.show()