This file contains hidden or 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
| fig, ax = plt.subplots(figsize=(15, 10)) | |
| animator = animation.FuncAnimation(fig, draw_barchart, frames=range(1990, 2019),interval=700) | |
| HTML(animator.to_jshtml()) | |
| # Set up formatting for the movie files | |
| writer = animation.FFMpegWriter(fps=10, metadata=dict(artist='Me'), bitrate=1800) | |
| animator.save("ref.mp4", writer=writer) |
This file contains hidden or 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
| colors = dict(zip( | |
| ['Latin America & Caribbean', 'South Asia', | |
| 'Sub-Saharan Africa', 'Europe & Central Asia', 'NA', | |
| 'Middle East & North Africa', 'East Asia & Pacific', 'North America'], | |
| ['#adb0ff', '#ffb3ff', '#90d595', '#e48381', | |
| '#aafbff', '#f7bb5f', '#eafb50', '#eacc10'] | |
| )) | |
| group_lk = df.set_index('name')['Region'].to_dict() |
This file contains hidden or 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
| import pandas as pd | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import matplotlib.ticker as ticker | |
| import matplotlib.animation as animation | |
| from IPython.display import HTML | |
| file_name = "refugee_data.xls" | |
| my_sheet = 'Data' |