How to add Error Bar to Matplotlib line plot?
Why not compute the x values explicitly? In the dataframe above,
x = [c for c in res.columns() if isinstance(int, c)]

Then, the code can be as follows.
badges = [&quot;A&quot;, &quot;B&quot;, &quot;C&quot;]
fig, ax = plt.subplots()
for badge in badges:
    means = res.iloc[:,2:].mean()
    std = res.iloc[:, 2:].std()
    means.plot(kind='line', label = badge)

    ax.plot(means)
    ax.fill_between(x, means.sub(std), means.add(std), color='b', alpha=.1)

Note: In the code above, you use badges only in the plot. Maybe computing means and std should be done outside the cycle? I am not sure because your sample data frame above does not have badges.