Skip to content

Commit

Permalink
Merge pull request #6 from domvwt/develop
Browse files Browse the repository at this point in the history
Update examples for Binder
  • Loading branch information
domvwt authored Apr 7, 2021
2 parents 5e44fd9 + 104e145 commit 9edca9a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
7 changes: 2 additions & 5 deletions docs/02-user-guide/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

### Data Analysis Report

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1Y_w1zECWDDk9qhCs3z7s3ZjLrt1ZId6Q?usp=sharing)
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/domvwt/esparto/blob/main/docs/examples/iris.ipynb)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/domvwt/esparto/main?filepath=docs%2Fexamples%2Firis.ipynb)

The iris dataset is one of the most well known datasets in statistics and data science. This example notebook shows how we can put together a simple data analysis report in esparto.

Expand All @@ -13,8 +14,4 @@ This example covers
* Converting a Pandas DataFrame to a table
* Adding plots from Matplotlib and Seaborn

<br>

<!-- [Jupyter Notebook](../examples/iris-data-analysis/) -->

<br>
19 changes: 14 additions & 5 deletions docs/examples/iris.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"outputs": [],
"source": [
"!pip install -Uqq esparto"
"!pip install -Uqq esparto pandas matplotlib seaborn"
]
},
{
Expand Down Expand Up @@ -1861,7 +1861,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"If you're running this notebook on Google Colab, click the link below to view the page."
"Click the link below to view the page."
]
},
{
Expand All @@ -1876,13 +1876,22 @@
},
"outputs": [],
"source": [
"msg = \"Click the link to see our generated webpage:\"\n",
"if 'google.colab' in str(get_ipython()):\n",
" from google.colab.output import eval_js\n",
" from IPython.display import display, Markdown\n",
" page_link = f\"{eval_js('google.colab.kernel.proxyPort(8000)')}{page_name}\"\n",
" print(\"Click the link to see our generated webpage:\", page_link)\n",
" print(msg, page_link)\n",
" print(\"(Interrupt the kernel to stop the http server process when you're done)\")\n",
" !python -m http.server 8000 > /dev/null 2>&1"
" !python -m http.server 8000 > /dev/null 2>&1\n",
"elif os.environ[\"BINDER_SERVICE_HOST\"]:\n",
" import socket\n",
" hash_id = socket.gethostname()[-8:]\n",
" page_link = f\"https://hub-binder.mybinder.ovh/user/domvwt-esparto-{hash_id}/view/docs/examples/iris-report.html\"\n",
" print(msg, page_link)\n",
"else:\n",
" page_link = \"./iris-report-html\"\n",
" print(msg, pagelink)"
]
},
{
Expand Down Expand Up @@ -1921,4 +1930,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "esparto"
version = "0.1.0.dev4"
version = "0.1.0"
description = "Simple toolkit for building accessible and shareable HTML documents."
authors = ["Dominic Thorn <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 9edca9a

Please sign in to comment.