The Python route
- Install the library and ffmpeg: pip install bar_chart_race, plus ffmpeg on your system for MP4 output.
- Load your data with pandas so each row is a date and each column an item: df = pd.read_csv('data.csv', index_col='date', parse_dates=['date']).
- Render it: import bar_chart_race as bcr, then bcr.bar_chart_race(df=df, filename='race.mp4', n_bars=10, period_length=500, steps_per_period=20).
- Tune the title, colors and figure size with the function's arguments, and re-render.
Things to watch out for
- The bar_chart_race package's last release was in 2020, so recent pandas or matplotlib versions can need small fixes or a maintained fork.
- Rendering a long race with many steps per period can take minutes.
- Vertical 9:16 output, safe zones, fonts and end cards are all up to you.
- Plotly's animation_frame gives an interactive alternative for notebooks, but exporting it to video takes extra work.
The no-code route
Same data, same chart, with easing, labels, captions and a leaderboard ending built in:
- Save the same DataFrame with df.to_csv() or copy it from a notebook.
- Paste it into the MakeYourChart editor and choose Bar race.
- Pick 9:16 or 16:9, write a hook title, and export the MP4.