diff --git a/README.md b/README.md index d7f9d07..48ada36 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,9 @@ 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. @@ -17,7 +17,6 @@ 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 diff --git a/Vagrantfile b/Vagrantfile index 3dbda0d..943f32d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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 @@ -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" diff --git a/vmfiles/IPNB/Examples/c Pandas/01 Pandas dataframe.ipynb b/vmfiles/IPNB/Examples/c Pandas/01 Pandas dataframe.ipynb index 765b33a..14f97e9 100644 --- a/vmfiles/IPNB/Examples/c Pandas/01 Pandas dataframe.ipynb +++ b/vmfiles/IPNB/Examples/c Pandas/01 Pandas dataframe.ipynb @@ -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" @@ -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" ] }, @@ -485,7 +483,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -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 } diff --git a/vmfiles/IPNB/Examples/e R/01 R basics.ipynb b/vmfiles/IPNB/Examples/e R/01 R basics.ipynb index 269ae7a..327db29 100644 --- a/vmfiles/IPNB/Examples/e R/01 R basics.ipynb +++ b/vmfiles/IPNB/Examples/e R/01 R basics.ipynb @@ -5,13 +5,17 @@ "metadata": {}, "source": [ "# Simple tests for an R kernel\n", - "This shows basic R manipulation. No access to Spark yet." + "\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" @@ -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()" ] }, { @@ -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()" ] }, { @@ -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 } diff --git a/vmfiles/IPNB/Examples/g Misc/10 ipywidgets.ipynb b/vmfiles/IPNB/Examples/g Misc/10 ipywidgets.ipynb index 4b6a387..6388824 100644 --- a/vmfiles/IPNB/Examples/g Misc/10 ipywidgets.ipynb +++ b/vmfiles/IPNB/Examples/g Misc/10 ipywidgets.ipynb @@ -5,6 +5,7 @@ "metadata": {}, "source": [ "# Ipywidgets\n", + "\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", @@ -17,7 +18,6 @@ "metadata": {}, "outputs": [], "source": [ - "from __future__ import print_function\n", "from ipywidgets import widgets" ] }, @@ -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." ] }, { @@ -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", @@ -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." ] }, { @@ -154,7 +163,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -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 }