# Use python dataframe in clientside javascript

**URL:** <https://discourse.jupyter.org/t/use-python-dataframe-in-clientside-javascript/671>\
**Category:** JupyterLab\
**Tags:** jupyterlab\
**Created:** [April 1, 2019, 7:23pm UTC](https://discourse.jupyter.org/t/use-python-dataframe-in-clientside-javascript/671 "2019-04-01T19:23:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nite](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/nite/32/358_2.png) [@nite](https://discourse.jupyter.org/u/nite)\
**Post date:** [April 1, 2019, 7:23pm UTC](https://discourse.jupyter.org/t/use-python-dataframe-in-clientside-javascript/671/1 "2019-04-01T19:23:01Z")

</div>

Hi - I’ve got a notebook with some client-side javascript implementing d3 & Plotly plots plus a http fetch, see:

> <https://gist.github.com/nite/2e1f0be26b493f034108d30b9f1cc994>

Is there any way I could load a dataframe in python, marshall the dataframe easily, ie via jupyter’s websockets connection, not via a http fetch but with some simple python/javascript combo. I’m looking for something as simple as importing a dataframe in R from python

Note, this is clientside javascript for in-browser javascript data visualization - ie. `%%javascript` magic, not serverside nodejs (pixiedust etc).

Bonus points: is there any way we could have intellisense/code completion for clientside javascript?

I’m looking to get as close as possible to replicating the [observablehq.com](https://observablehq.com/) experience within Jupyter, to allow python data scientists to explore javascript data viz alongside python more easily.

---

<div class="post-metadata">

**Author:** ![nite](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/nite/32/358_2.png) [@nite](https://discourse.jupyter.org/u/nite)\
**Post date:** [April 1, 2019, 8:21pm UTC](https://discourse.jupyter.org/t/use-python-dataframe-in-clientside-javascript/671/2 "2019-04-01T20:21:03Z")

</div>

This works for small dataframes:

```
from IPython.display import Javascript
Javascript('window.df={}'.format(df.to_json(orient='records')))

```

However, it quickly falls over for larger dataframes.

If anyone has any better ideas, or can comment on intellisense/code completion in `%%js` then please let me know!
