Created
August 20, 2022 11:15
-
-
Save lmeulen/73b2f97b42660630d1568237218d96fb to your computer and use it in GitHub Desktop.
ergast_most_wins_no_champ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
winners = stats.get_winners() | |
wins_per_driver = winners[['driverId', 'year']].groupby('driverId').count(). \ | |
reset_index().rename(columns={"year": "podiums"}) | |
champs = pd.unique(stats.get_wdc_champions()['driverId']) | |
not_champ = wins_per_driver[~wins_per_driver.driverId.isin(champs)] | |
not_champ = not_champ.merge(stats.get_table('drivers')) | |
stats.horizontal_barplot(df=not_champ, rowcount=10, sort_value='podiums', | |
sort_ascending=False, | |
xcolumn='name', ycolumn='podiums', | |
title='Drivers with most wins without winning a championship', | |
xlabel='wins', ylabel='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment