Question: df_high = df_all[['model_cd', 'modelname', 'installcost','yearlyupkeep', 'Efficiency']][df_all['Efficiency']==High] high_efficiency_model = df_high[['model_cd', 'modelname','installcost', 'yearlyupkeep','Efficiency']].groupby('Efficiency') high_efficiency_model.to_csv(index = True) keep getting an error saying : AttributeError: 'DataFrameGroupBy' object has no

df_high = df_all[['model_cd', 'modelname', 'installcost','yearlyupkeep', 'Efficiency']][df_all['Efficiency']=="High"]
high_efficiency_model = df_high[['model_cd', 'modelname','installcost', 'yearlyupkeep','Efficiency']].groupby('Efficiency')
high_efficiency_model.to_csv(index = True)

keep getting an error saying :

AttributeError: 'DataFrameGroupBy' object has no attribute'to_csv'

How to fix

Step by Step Solution

3.34 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It looks like you are trying to use the tocsv method on a DataFrameGroupBy ob... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!