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')
    plt.show()
  
    return df

P1 = make_plot(df)


Read more here: https://stackoverflow.com/questions/68447722/list-has-no-attribute-plot-using-pandas-when-used-while-defining-inside-functi

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: