import pandas as pd import numpy as np import matplotlib.pyplot as plt import plotly.express as px import seaborn as sns import plotly.express as px import plotly.graph_objects as go import datetime as datetime from datetime import timedelta from plotly.subplots import make_subplots #pip install bar_chart_race import bar_chart_race as bcr url = 'http://apmonitor.com/che263/uploads/Main/' data = pd.read_csv(url+'programming_languages.csv') data['Date'] = pd.to_datetime(data['Date']).dt.strftime('%Y-%m') df=data.copy() df.index=df['Date'].tolist() df=df.drop('Date',axis=1) def make_bcr(df): bcr.bar_chart_race( df=df, filename='programming_languages.mp4', orientation='h', sort='desc', n_bars=20, fixed_order=False, fixed_max=False, steps_per_period=6,#speed control interpolate_period=False, label_bars=True, bar_size=.95, period_label={'x': .99, 'y': .25, 'ha': 'right', 'va': 'center'}, #period_fmt='%B %d, %Y', period_summary_func=lambda v, r: {'x': .99, 'y': .18,'s': '', 'ha': 'right', 'size': 8, 'family': 'Courier New'}, period_length=400, figsize=(5,3), dpi=500, cmap='dark24', title='Programming Language Popularity', title_size=10, bar_label_size=7, tick_label_size=5, shared_fontdict={'color' : '.1'}, scale='linear', writer=None, fig=None, bar_kwargs={'alpha': .7}, filter_column_colors=True) make_bcr(df)