python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -
i´m new programming. i´m trying use scipy minimize, had several issues , gotten through of them.
right code, i'm not understanding why i´m getting error.
par_opt = so.minimize(fun=fun_obj, x0=par_ini, method='nelder-mead', args=[series_pt_cal, dt, series_caudal_cal])
not enough info given op, somewhere in code it's specified operate data frame column (axis=1) on object pandas series. if code typically works occasional gives errors, check degenerative cases data frame may have 1 row. pandas has nasty habit of guessing want -- may decide reduce 1-row data frame series (e.g., apply()
function; can disable using reduce=false
in there).
add line of code check object isinstance(df, pd.dataframe)
or else convert offending pandas series data frame, s.to_frame().t
problems had deal with.
Comments
Post a Comment