# Third Party Libraries With Rich Output

A number of third party libraries defined their own custom display logic. This gives their objcts rich output by default when used in the Notebook.


```python
from IPython.display import display
```

## Pandas

[Pandas](http://pandas.pydata.org/) is a data analysis library for Python. Its `DataFrame` objects have an HTML table representation in the Notebook.


```python
import pandas
```

Here is a small amount of stock data for APPL:


```python
%%writefile data.csv
Date,Open,High,Low,Close,Volume,Adj Close
2012-06-01,569.16,590.00,548.50,584.00,14077000,581.50
2012-05-01,584.90,596.76,522.18,577.73,18827900,575.26
2012-04-02,601.83,644.00,555.00,583.98,28759100,581.48
2012-03-01,548.17,621.45,516.22,599.55,26486000,596.99
2012-02-01,458.41,547.61,453.98,542.44,22001000,540.12
2012-01-03,409.40,458.24,409.00,456.48,12949100,454.53
```

Read this as into a `DataFrame`:


```python
df = pandas.read_csv('data.csv')
```

And view the HTML representation:


```python
df
```

## SymPy

[SymPy](http://sympy.org/) is a symbolic computing library for Python. Its equation objects have LaTeX representations that are rendered in the Notebook.


```python
from sympy.interactive.printing import init_printing
init_printing(use_latex='mathjax')
```


```python
from __future__ import division
import sympy as sym
from sympy import *
x, y, z = symbols("x y z")
k, m, n = symbols("k m n", integer=True)
f, g, h = map(Function, 'fgh')
```


```python
Rational(3,2)*pi + exp(I*x) / (x**2 + y)
```


```python
a = 1/x + (x*sin(x) - 1)/x
a
```


```python
(1/cos(x)).series(x, 0, 6)
```

## Vincent

[Vincent](https://vincent.readthedocs.io/en/latest/) is a visualization library that uses the [Vega](http://trifacta.github.io/vega/) visualization grammar to build [d3.js](http://d3js.org/) based visualizations in the Notebook and on http://nbviewer.ipython.org. `Visualization` objects in Vincetn have rich HTML and JavaSrcript representations.


```python
import vincent
import pandas as pd
```


```python
vincent.initialize_notebook()
```


```python
line = vincent.Line(df[['Open', 'High', 'Close']], width=600, height=300)
line.axis_titles(x='Date', y='Price')
line.legend(title='Ticker')
display(line)
```

## Cleanup


```python
!rm -f data.csv
```


```python

```

3ece56635d6afbec004c53b5dcbdd58d13154ce0
ipynb
Jupyter Notebook
001-Jupyter/001-Tutorials/003-IPython-in-Depth/examples/IPython Kernel/Third Party Rich Output.ipynb
jhgoebbert/jupyter-jsc-notebooks
bcd08ced04db00e7a66473b146f8f31f2e657539
BSD-3-Clause
001-Jupyter/001-Tutorials/003-IPython-in-Depth/examples/IPython Kernel/Third Party Rich Output.ipynb
jhgoebbert/jupyter-jsc-notebooks
bcd08ced04db00e7a66473b146f8f31f2e657539
BSD-3-Clause
001-Jupyter/001-Tutorials/003-IPython-in-Depth/examples/IPython Kernel/Third Party Rich Output.ipynb
jhgoebbert/jupyter-jsc-notebooks
bcd08ced04db00e7a66473b146f8f31f2e657539
BSD-3-Clause
2022-01-13T18:49:12.000Z
2022-01-13T18:49:12.000Z
Qwen/Qwen-72B
1. YES
2. YES