python - Length mismatch: Expected axis has 218 elements, new values have 230 elements -
i have been accessing pandas data frame, , error keeps popping up.
cases_expand = [] case in cases_ii: output = case[-1][0] month = case[-1][1] features = [v[0] v in case[0:-1]] + [month] + [output] cases_expand.append(features) feat = ["h_", "r_", "in_umiray_", "in_angat_", "out_nia_", "out_mwss_"] cases_df2 = pd.dataframe(cases_expand) col_names = [] f in feat: if f != "out_nia_" , f != "out_mwss_": in range(batch_size): col_names.append(f+str(i+1)) else: in range(look_back + batch_size): col_names.append(f+str(i+1)) col_names += ["month", "output"] #print (col_names) cases_df2.columns = col_names print (col_names)
the error is:
length mismatch: expected axis has 218 elements. new values has 230 elements.
Comments
Post a Comment