Skip to content

Instantly share code, notes, and snippets.

View munael's full-sized avatar

Muhammad N ElNokrashy munael

View GitHub Profile
@munael
munael / dataclass_from_dict.py
Created September 18, 2019 23:03 — forked from gatopeich/dataclass_from_dict.py
Python 3.7 dataclass to/from dict/json
from dataclasses import dataclass, fields as datafields
from ujson import dumps, loads
# Note: ujson seamlessly serializes dataclasses, unlike stdlib's json
@dataclass
class Point:
x: float
y: float
# Shallow dataclass can be rebuilt from dict/json:
@munael
munael / graph.py
Last active October 4, 2022 23:06 — forked from c0nn3r/graph.py
Nice graph formatting. (from c0nn3r)
import re
import os
import glob
import pandas as pd
import matplotlib.pyplot as plt
from collections import OrderedDict
fig_size = [12, 9]