Created
November 18, 2016 00:32
-
-
Save jassinm/dab6ccd40064dd6c6aa3cd4abaa2af34 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
| #+BEGIN_SRC ipython :session | |
| import numpy as np | |
| import pandas as pd | |
| import matplotlib as mpl | |
| import matplotlib.pyplot as plt | |
| import pandas as pd | |
| graylevel = 1.0 | |
| mpl.rc('figure', facecolor = (graylevel, graylevel, graylevel), edgecolor ='r') | |
| %pylab inline | |
| #+END_SRC | |
| #+RESULTS: | |
| #+BEGIN_SRC ipython :session :file /tmp/py8494Rwq.png :exports both | |
| fig = plt.figure(facecolor='white') | |
| plt.hist(np.random.randn(20000), bins=100) | |
| #+END_SRC | |
| #+RESULTS: | |
| [[file:/tmp/py8494Rwq.png]] | |
| #+BEGIN_SRC ipython :session :results output raw | |
| from tabulate import tabulate | |
| df = pd.DataFrame(np.random.random((4,3)), columns=['A','B','C']) | |
| print tabulate(df, headers="keys", tablefmt="orgtbl") | |
| #+END_SRC | |
| #+RESULTS: | |
| | | A | B | C | | |
| |---+----------+----------+----------| | |
| | 0 | 0.409008 | 0.131716 | 0.267215 | | |
| | 1 | 0.949154 | 0.760575 | 0.645162 | | |
| | 2 | 0.1266 | 0.476123 | 0.856961 | | |
| | 3 | 0.282386 | 0.606108 | 0.409315 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment