import pandas as pd
import csv
import plotly.graph_objects as go

df = pd.read_csv("data_csv")

student_df = df.loc[df['student_id'] == "TRL_1000"]

print(student_df.groupby("level")["attempt"].mean())

fig = go.Figure(go.bar(
            x=student_df.groupby("level")["attempt"].mean(),
            y=['level 1', 'level 2', 'level 3', 'level 4'],
            orientation = 'h'
))

fig.show()