list has no attribute ‘plot’ using pandas when used while defining inside function

import pandas as pd
import matplotlib pyplot as plt
def make_plot(df):

    df = df.plot(type='line',x='price',y ='commodity',color = 'green')
    return df

P1 = make_plot(df)

Read more here:

Content Attribution

This content was originally published by goonga steel at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: