I have this dataframe.

`t = pd.DataFrame({'A':[1,2,3,4], 'B':[40,50,60, 70], 'C':[400, 500, 600 ,700]}) `

and the series:

`s = pd.Series([10000, 12000, 14000, 16000]) `

I merge them:

`df = t.assign(target = s) `

Now, I want to groupby column ‘B’ by intervals of 10 and plot ‘A’ versus various ‘target’ values.

I want to have 4 different line plots.

If I do :

`fig, ax = plt.subplots() new_df = df.groupby(pd.cut(df.iloc[:, 1], np.arange(0, max(df.iloc[:, 1]) + 10, 10))).sum() new_df.plot(x='A', y='target', ax=ax, legend=True, kind='line') `

I want to have 4 different lines. I am trying something like (it’s not right):

`for col, b in df.groupby(pd.cut(df.iloc[:, 1], np.arange(0, max(df.iloc[:, 1]) + 10, 10))).sum(): ax = b.plot(ax=ax, kind='line', x = 'A', y = 'target', c=col, label=col) `

(this gives ‘not enough values to unpack (expected 2 got 1)’)

but I am not sure how to loop through this grouping.