onlyphantom/pedagogy

Column names in leaderboard table

bagasbgy opened this issue · 1 comments

It would be better if the column names in leaderboard table renamed into more user-friendly names before rendering it into an HTML table.

image

Wow can't believe it took that long for this. Such a simple enhancement:

df[df.name != 'Capstone'].loc[:,['name','workshop_hours', 'class_size']].groupby(
            'name').sum().sort_values(
                by='class_size', 
                ascending=False)
                .head(10)
                .rename_axis(None)
                .rename(
                    columns={'workshop_hours':'Total Hours',
                          'class_size':'Total Students'})
                .to_html(classes=['table thead-light table-striped table-bordered table-hover table-sm'], )