First you need to install xcode from the app store
Then you can run:
xcode-select --install
See Here for why
import calplot | |
cfg_date_ranges = { "test_date_ranges": [ | |
[ | |
"2011-01-01", | |
"2011-12-31" | |
], | |
[ | |
"2020-01-01", | |
"2020-12-31" |
conda create -n stan2 python=3.7 --yes | |
conda activate stan2 | |
conda install -c anaconda gcc_linux-64 gxx_linux-64 --yes | |
## FOR MAC: | |
# conda install -c anaconda clang_osx-64 clangxx_osx-64 --yes | |
conda install -c conda-forge numpy pandas scipy cython ipython jupyterlab matplotlib freetype --yes | |
python -m pip install --upgrade pip | |
pip install pystan==2.19.0.0 | |
conda install -c conda-forge arviz --yes |
conda create -n stan --yes | |
conda activate stan | |
conda install pip --yes | |
# Install httpstan from source (this will take a while). | |
pip install -v git+https://github.com/tillahoffmann/httpstan@pip | |
# Install pystan. | |
pip install 'pystan>=3' | |
# Try a dummy program (this should report build and sampling progress). | |
python -c 'import stan; stan.build("parameters { real x; } model { x ~ normal(0, 1); }").sample()' |
First you need to install xcode from the app store
Then you can run:
xcode-select --install
See Here for why
conda create -n h2ox --yes | |
conda activate h2ox | |
conda install pytorch torchvision cudatoolkit -c pytorch --yes | |
conda install -c conda-forge jupyterlab seaborn loguru --yes | |
conda install -c conda-forge netcdf4 numba tqdm tensorboard ipython pip ruamel.yaml xarray descartes scikit-learn black mypy xskillscore cdsapi cftime --yes | |
# conda install -c alex-marty sacred | |
pip install sacred | |
pip install geopandas |
from matplotlib import cm | |
from matplotlib.colors import ListedColormap, LinearSegmentedColormap | |
import seaborn as sns | |
n_unique_vals = 5 | |
colors = cm.get_cmap('viridis', n_unique_vals)(np.linspace(0, 1, n_unique_vals)) | |
sns.palplot(colors) | |
# create colormap and mappable for colorbar construction | |
cmap = LinearSegmentedColormap.from_list("RANDOM", colors, N=n_pcs) |
conda create -n gdal --yes | |
conda activate gdal | |
conda install -c conda-forge gdal --yes | |
conda install -c conda-forge rioxarray geopandas --yes | |
conda install -c conda-forge netcdf4 xarray ipython six scipy scikit-learn seaborn matplotlib jupyterlab --yes |
import pandas as pd | |
from pathlib import Path | |
import numpy as np | |
from datetime import datetime | |
# CHANGE THIS >>>>>>>>> | |
DATA_DIR = "/Users/tommylees/Downloads" | |
USER = "kouji" | |
FIRST_ROW_TO_READ = 13 # remember it is 0-based indexing |
from pathlib import Path | |
from cmdstanpy import cmdstan_path, CmdStanModel, CmdStanMCMC | |
import pandas as pd | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from typing import Dict | |
import arviz as az | |
model_dir = Path("stan_code") |