How to make this plot with python
Maybe you can modify my code:

   import numpy as np

   Duration_ = np.random.choice(range(0,56), 10000)


   Binary_Level = []

   b_ =["correct", "incorrect"]

   Binary_Level = np.random.choice(b_, 10000)

   import pandas as pd

   dd = pd.DataFrame({'Duration_': Duration_, 'Binary_Level': 
      Binary_Level})

   xr_ = list(range(0,56,5))

   y_ = []

   for i in range(0,(len(xr_)-1)):

       a_ = np.logical_and(dd['Duration_'].values&gt;=xr_[i], 
       dd['Duration_'].values&lt;xr_[i+1])
       b_ = np.logical_and(np.logical_and(dd['Duration_'].values&gt;=xr_[i], 
       dd['Duration_'].values&lt;xr_[i+1]),
                               dd['Binary_Level'].values=='correct')
       y_.append(sum(b_)/sum(a_))

    import matplotlib
    matplotlib.pyplot.plot(xr_[1:12], y_)