Well, instead of creating a new DataFrame, just renaming the axis works. To do that, here is the code: set_theme_counts.rename_axis('id').reset_index(name='set_count')
set_theme_counts.rename_axis('id').reset_index(name='set_count')