Skip to content

Instantly share code, notes, and snippets.

@amancevice
Last active August 17, 2016 13:53
Show Gist options
  • Save amancevice/91ed72ccb41f8dfdcfde83aab0467f7b to your computer and use it in GitHub Desktop.
Save amancevice/91ed72ccb41f8dfdcfde83aab0467f7b to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plotly / Cufflinks Configuration"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import cufflinks\n",
"import plotly\n",
"\n",
"\n",
"plotly.offline.init_notebook_mode()\n",
"cufflinks.set_config_file(offline=True, offline_show_link=False, theme='ggplot')"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Plot"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas\n",
"import random\n",
"\n",
"frame = pandas.DataFrame(pandas.np.random.randn(50, 4), columns=list('ABCD'))\n",
"frame.iplot()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Dockerfile\n",
"\n",
"```\n",
"FROM amancevice/pandas:0.18.1\n",
"\n",
"RUN apk add --no-cache g++\n",
"RUN pip install cufflinks==0.7.1 jupyter==1.0.0 plotly==1.9.5\n",
"\n",
"EXPOSE 8888\n",
"\n",
"WORKDIR /notebooks\n",
"\n",
"CMD jupyter notebook --ip=* --no-browser\n",
"```\n",
"\n",
"## Docker Build / Run\n",
"\n",
"```\n",
"docker build -t plotly .\n",
"docker run --rm -it --name plotly -p 8888:8888 -v $(pwd):/notebooks plotly\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"backports-abc==0.4\r\n",
"backports.shutil-get-terminal-size==1.0.0\r\n",
"certifi==2016.8.8\r\n",
"colorlover==0.2.1\r\n",
"configparser==3.5.0\r\n",
"cufflinks==0.7.1\r\n",
"decorator==4.0.10\r\n",
"entrypoints==0.2.2\r\n",
"functools32==3.2.3.post2\r\n",
"ipykernel==4.4.1\r\n",
"ipython==5.1.0\r\n",
"ipython-genutils==0.1.0\r\n",
"ipywidgets==5.2.2\r\n",
"Jinja2==2.8\r\n",
"jsonschema==2.5.1\r\n",
"jupyter==1.0.0\r\n",
"jupyter-client==4.3.0\r\n",
"jupyter-console==5.0.0\r\n",
"jupyter-core==4.1.1\r\n",
"MarkupSafe==0.23\r\n",
"mistune==0.7.3\r\n",
"nbconvert==4.2.0\r\n",
"nbformat==4.1.0\r\n",
"notebook==4.2.2\r\n",
"numpy==1.11.0\r\n",
"pandas==0.18.1\r\n",
"pathlib2==2.1.0\r\n",
"pexpect==4.2.0\r\n",
"pickleshare==0.7.4\r\n",
"plotly==1.9.5\r\n",
"prompt-toolkit==1.0.6\r\n",
"ptyprocess==0.5.1\r\n",
"Pygments==2.1.3\r\n",
"python-dateutil==2.5.3\r\n",
"pytz==2016.4\r\n",
"pyzmq==15.4.0\r\n",
"qtconsole==4.2.1\r\n",
"requests==2.11.0\r\n",
"simplegeneric==0.8.1\r\n",
"singledispatch==3.4.0.3\r\n",
"six==1.10.0\r\n",
"terminado==0.6\r\n",
"tornado==4.4.1\r\n",
"traitlets==4.2.2\r\n",
"wcwidth==0.1.7\r\n",
"widgetsnbextension==1.2.6\r\n"
]
}
],
"source": [
"!pip freeze"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment