Skip to content

Commit

Permalink
UNED 7.0 (2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovn committed Mar 16, 2024
1 parent 804498a commit 5e99340
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 31 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ This instance builds on the `ml-base64` VM (which already provides all
the needed software packages, on an Ubuntu 22.04 box). On top of that, it
configures and launches a Jupyter Notebook process, exported as an HTTP service
to a local port. It allows creating notebooks with two different kernels:
* Python 3.10 (plain Python, with additional libraries such as NumPy, SciPy,
* Python 3.10 (Python, with installed additional libraries such as NumPy, SciPy,
Pandas, Matplotlib, Scikit-learn, etc),
* R
* R (IRkernel)

The repository also contains a number of small example notebooks.

The contents of the VM are:
* Python 3.10
* A virtualenv for Python 3.10 with a scientific Python stack (scipy, numpy, matplotplib, pandas, statmodels, scikit-learn, gensim, xgboost, networkx, seaborn, pylucene and a few others) plus IPython 8 + Jupyter notebook
* R 4.3 with a few packages installed (rmarkdown, magrittr, dplyr, tidyr, data.table, ggplot2, caret, plus their dependencies).
* A few small notebook extensions


## Installation
Expand Down
6 changes: 3 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# **************************************************************************

# --------------------------------------------------------------------------
# Variables defining the configuration of notebook
# Variables defining the configuration of the notebook environment
# Modify as needed

# RAM memory used for the VM, in MB
Expand Down Expand Up @@ -60,10 +60,10 @@ Vagrant.configure(2) do |config|

# The base box we are using. As fetched from ATLAS
vgrml.vm.box = "paulovn/ml-base64"
vgrml.vm.box_version = "= 3.3.0"
vgrml.vm.box_version = "= 3.3.1"

# Alternative place: box elsewhere
#vgrml.vm.box_url = "http://tiny.cc/ml-base64-330-box"
#vgrml.vm.box_url = "http://tiny.cc/ml-base64-331-box"
# Alternative place: local box
#vgrml.vm.box_url = "file:///almacen/VM/Export/VagrantBox/ml-base64-LOCAL.json"

Expand Down
10 changes: 4 additions & 6 deletions vmfiles/IPNB/Examples/c Pandas/01 Pandas dataframe.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import print_function \n",
"\n",
"# Import Pandas & NumPy\n",
"import pandas as pd\n",
"import numpy as np"
Expand Down Expand Up @@ -404,7 +402,7 @@
"outputs": [],
"source": [
"# Now append this set of rows to the original one\n",
"df = df.append(df2, sort=False)\n",
"df = pd.concat([df, df2], sort=False)\n",
"df"
]
},
Expand Down Expand Up @@ -485,7 +483,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -499,9 +497,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
18 changes: 11 additions & 7 deletions vmfiles/IPNB/Examples/e R/01 R basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
"metadata": {},
"source": [
"# Simple tests for an R kernel\n",
"This shows basic R manipulation. No access to Spark yet."
"<!-- version: 1.2, 2023 -->\n",
"This shows basic R manipulation. No access to Spark."
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"## Data manipulation"
Expand Down Expand Up @@ -100,7 +104,7 @@
"library('ggplot2')\n",
"\n",
"# A density plot\n",
"qplot( dvalue1, data=exdf, geom=\"density\" )"
"ggplot(data=exdf, aes(x=dvalue1)) + geom_density()"
]
},
{
Expand All @@ -110,10 +114,10 @@
"outputs": [],
"source": [
"# Change default plot size (values in inches)\n",
"options(repr.plot.width = 10, repr.plot.height = 5)\n",
"options(repr.plot.width = 12, repr.plot.height = 8)\n",
"\n",
"# A scatterplot, discriminating by the factor in the 'vtype' column\n",
"qplot( dvalue1, dvalue2, color=vtype, data=exdf )"
"ggplot(data=exdf, aes(x=dvalue1, y=dvalue2, color=vtype)) + geom_point()"
]
},
{
Expand Down Expand Up @@ -156,9 +160,9 @@
"mimetype": "text/x-r-source",
"name": "R",
"pygments_lexer": "r",
"version": "3.6.2"
"version": "4.3.1"
}
},
"nbformat": 4,
"nbformat_minor": 1
"nbformat_minor": 4
}
33 changes: 21 additions & 12 deletions vmfiles/IPNB/Examples/g Misc/10 ipywidgets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"metadata": {},
"source": [
"# Ipywidgets\n",
"<!-- version: 1.1, 2023 -->\n",
"\n",
"[ipywidgets](https://ipywidgets.readthedocs.io/en/stable/) is a Python package providing interactive widgets for Jupyter notebooks.\n",
"* [ipywidgets installation](https://github.com/jupyter-widgets/ipywidgets/blob/master/README.md#install)\n",
Expand All @@ -17,7 +18,6 @@
"metadata": {},
"outputs": [],
"source": [
"from __future__ import print_function\n",
"from ipywidgets import widgets"
]
},
Expand All @@ -27,7 +27,7 @@
"source": [
"## Text example\n",
"\n",
"This example shows a text box. The widget handler just receives the text and prints it out."
"This example shows a text box. The widget handler just receives the text and fills another widget (a text label) with it."
]
},
{
Expand All @@ -38,18 +38,25 @@
"source": [
"from IPython.display import display\n",
"\n",
"def handle_submit(sender):\n",
" print(\"Submitted:\", text.value)\n",
" \n",
"lbl = widgets.Label()\n",
"text = widgets.Text()\n",
"display(text)\n",
"text.on_submit(handle_submit)"
"\n",
"def handle_submit(sender):\n",
" lbl.value = f\" The text is: {text.value}\"\n",
"\n",
"display(widgets.HBox([text, lbl]))\n",
"\n",
"text.continuous_update = False\n",
"text.observe(handle_submit)"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"## Interact\n",
Expand Down Expand Up @@ -114,7 +121,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Boxes"
"## Layout\n",
"\n",
"Build a more complex layout by adding together widgets vertically and/or horizontally."
]
},
{
Expand Down Expand Up @@ -154,7 +163,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -168,9 +177,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
"version": "3.10.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

0 comments on commit 5e99340

Please sign in to comment.