Skip to content

Instantly share code, notes, and snippets.

View dhowland's full-sized avatar

David Howland dhowland

View GitHub Profile
@mattmills49
mattmills49 / display_hist.py
Last active February 26, 2024 07:16
A python function for printing a histogram as a unicode text string, e.g. '▁▂▄█▆▃▁▁'
import numpy as np
import functools as ft
def display_hist(x, num_bins = 8, zeros_as_blank = False):
'''Returns a histogram as a unicode text string, e.g. '▁▂▄█▆▃▁▁'
Inspired by the `precis` function from the Statistical Rethinking R package
by Richard McElreath. This function will calculate a histogram and then
returns a string displaying the histogram in unicode characters. It uses the
LOWER BLOCK group like "2584 ▄ LOWER HALF BLOCK".
@dupuy
dupuy / README.rst
Last active March 31, 2024 00:29
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.