Skip to content

Instantly share code, notes, and snippets.

View chaksoham's full-sized avatar
🎯
Focusing

soham chakraborti chaksoham

🎯
Focusing
View GitHub Profile
@chaksoham
chaksoham / render.py
Created January 6, 2020 00:36
render race graph
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)
@chaksoham
chaksoham / displaycharts.py
Last active January 6, 2020 00:35
displaymethods
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()
@chaksoham
chaksoham / PreprocessingData.py
Last active January 6, 2020 00:25
Refugee data
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'