Skip to content

Instantly share code, notes, and snippets.

@ebarcikowski
Created January 7, 2018 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebarcikowski/347ddfd2b836a2cc29788cd37c4e7ab1 to your computer and use it in GitHub Desktop.
Save ebarcikowski/347ddfd2b836a2cc29788cd37c4e7ab1 to your computer and use it in GitHub Desktop.
# either put in startup file or at start of ob-ipython based org
# document.
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sb
import numpy as np
import pandas as pd
import math
from scipy.stats import norm
import matplotlib as mpl
mpl.rcParams['axes.facecolor'] = 'white'
mpl.rcParams['axes.edgecolor'] = 'black'
mpl.rcParams['figure.facecolor'] = 'white'
mpl.rcParams['figure.edgecolor'] = 'black'
mpl.rcParams['figure.figsize'] = (12, 8)
import IPython
from tabulate import tabulate
class OrgFormatter(IPython.core.formatters.BaseFormatter):
def __call__(self, obj):
try:
return tabulate(obj, headers='keys',
tablefmt='orgtbl', showindex='always')
except:
return None
ip = get_ipython()
ip.display_formatter.formatters['text/org'] = OrgFormatter()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment