0

I am trying to sort values descendingly for:-

FeatureImportances=pd.DataFrame(Tclf.feature_importances_,index=Name_features).sort_values(by='',axis = 0, ascending = False)

whenever I try to assign a feature"column" Name to the attribute 'by', it gives me an error So, what to assign for the attribute 'by'!!

gtomer
  • 5,643
  • 1
  • 10
  • 21
Ahmed Adel
  • 49
  • 6
  • This would make your feature names as indices and a single column with the importance values. You needn't specify the by column since there is only one column or printout the column name and input that in your by parameter. – Nivi Sep 08 '22 at 16:23
  • I didn't really get that. I have to specify the by argument, otherwise, it gives me an error -->"sort_values() missing 1 required positional argument: 'by'" – Ahmed Adel Sep 08 '22 at 16:27

0 Answers0