Skip to content

Instantly share code, notes, and snippets.

@chrisbeardy
chrisbeardy / df_to_table.py
Created October 12, 2021 15:38 — forked from avi-perl/df_to_table.py
Convert a pandas.DataFrame object into a rich.Table object for stylized printing in Python.
from datetime import datetime
from typing import Optional
import pandas as pd
from rich import box
from rich.console import Console
from rich.table import Table
console = Console()
@chrisbeardy
chrisbeardy / json_problem.py
Created December 10, 2020 20:02
json_problem
# I have a json file which looks something like this
#
# {
# "a.a" : "hello",
# "a.b" : "world",
# "a.c.a" : 4,
# "a.c.b" : 5.5,
# "a.c.c.a" : "hi",
# "a.c.c.b" : "again",
# "b.a.a" : 6,