Skip to content

Instantly share code, notes, and snippets.

@niloch
niloch / df_pydantic_validate.ipynb
Created July 22, 2020 16:13
DataFrame Validation with Pydantic (including self validating dataframs)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@niloch
niloch / nn.py
Created May 20, 2020 04:09
Jax implementation of github.com/srush/parallax using [pydantic](https://pydantic-docs.helpmanual.io/) instead of dataclasses
"""
Abstract Base class with automatic Pytree registration
Inspired by from https://github.com/google/jax/issues/2916
"""
import json
from abc import abstractmethod
from typing import Any, Dict, List, Tuple
import jax.numpy as np
from jax import jit, vmap, random
@niloch
niloch / sankey_chart.py
Last active August 23, 2019 08:46
python sankey chart
from iplotter import GCPlotter
plotter = GCPlotter()
data = [
['From', 'To', 'Weight'],
['Brazil', 'Portugal', 5],
['Brazil', 'France', 1],
['Brazil', 'Spain', 1],
['Brazil', 'England', 1],