Sep-25-2019, 01:28 PM
I would like to create a subplot for every column in the dataframe but I am not able to achieve it when I tried to use the code below
how can I do this correctly? thanks
fig = plt.figure() # Extrapolate each column for col in df.columns: # Get the index values for NaNsY in the column x = df[pd.isnull(df[col])].index.astype(float).values x1 = df.index.astype(float).values y = df[col].values # Extrapolate those points with the fitted function df[col][x] = func(x, *col_params[col]) ax = fig.add_subplot(5,5,col) ax.plot(x1,y,func(x, *col_params[col]),'g--')TypeError: '<' not supported between instances of 'str' and 'int'
how can I do this correctly? thanks