The code you provided is generating a FutureWarning. To avoid this warning, you need to specify the numeric_only parameter in the sum() function. Here's the corrected code:

f7 = f6.groupby(['Area']).sum(numeric_only=True).reset_index()

This will sum only the numeric columns in the DataFrame f6 and reset the index of the resulting DataFrame f7.

f7 = f6groupbyAreasumreset_indexCUsersluon1AppDataLocalTempipykernel_24328385941377py1 FutureWarning The default value of numeric_only in DataFrameGroupBysum is deprecated In a future version numeric_

原文地址: https://www.cveoy.top/t/topic/i8hP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录