Loren Champlin
Adapted from Adarsh Pyarelal's WM 12 Month Evaluation Notebook
As always, we begin with imports, and print out the commit hash for a rendered version of the notebook.
%load_ext autoreload
%autoreload 2
%matplotlib inline
from IPython.display import set_matplotlib_formats
set_matplotlib_formats('retina')
import numpy as np
import pandas as pd
from delphi.db import engine
import random as rm
import delphi.evaluation_port as EN
import warnings
warnings.filterwarnings("ignore")
import logging
logging.getLogger().setLevel(logging.CRITICAL)
from delphi.cpp.DelphiPython import AnalysisGraph as AG, InitialBeta as IB, RNG
import time
import seaborn as sns
import matplotlib.pyplot as plt
from delphi.jupyter_tools import display
import seaborn as sns
from scipy import stats
import matplotlib.patches as mpatches
Here I will set random seeds
np.random.seed(87)
rm.seed(87)
EN.get_data_value('Net migration',year=2012,month=2, use_heuristic=True)
x = np.array([[1,2,2],[4,4,4],[8,3,4],[7,2,3]])
y = np.mean(x,axis=1)
ax = sns.lineplot(x=range(5),y=range(5))
help(mpatches.Patch)
query = " ".join(
[
f"select * from indicator",
]
)
results = engine.execute(query)
list(results)
query = " ".join(
[
f"select * from indicator",
f"where `Variable` is 'Historical Production (Maize)'",
]
)
results = engine.execute(query)
results_df2 = pd.DataFrame(results,columns=results.keys())
results_df2