Created
January 7, 2018 23:08
-
-
Save ebarcikowski/347ddfd2b836a2cc29788cd37c4e7ab1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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