From c2ac8e4c13dd5a3b821b8f98f499a5d319e5b181 Mon Sep 17 00:00:00 2001 From: raj_mathe Date: Sun, 23 Oct 2022 14:13:30 +0200 Subject: [PATCH] master > master: notebook - cleanup --- notebooks/week-2.ipynb | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/notebooks/week-2.ipynb b/notebooks/week-2.ipynb index 8f682e9..db796fa 100644 --- a/notebooks/week-2.ipynb +++ b/notebooks/week-2.ipynb @@ -22,8 +22,9 @@ "metadata": {}, "outputs": [], "source": [ + "# imports\n", "import os;\n", - "import sys;\n", + "import sys; \n", "\n", "# NOTE: need this to force jupyter to reload imports:\n", "for key in list(sys.modules.keys()):\n", @@ -49,11 +50,21 @@ "metadata": {}, "outputs": [], "source": [ - "FunctionDiagramWidget(\n", - " N = 2,\n", - " fnames = ['f', 'g', 'h', 'i', 'j'],\n", - " setnames = ['X', 'Y', 'Z', 'U', 'V', 'W'],\n", - ").run();" + "# Userinput - Anzahl der Funktionen\n", + "fnames = ['f', 'g', 'h', 'i', 'j'];\n", + "setnames = ['X', 'Y', 'Z', 'U', 'V', 'W'];\n", + "ctrl = widgets.IntSlider(value=1, description=f'# Funktionen', min=1, max=len(fnames));\n", + "display(ctrl);" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Widget - Mengen und Funktionen\n", + "FunctionDiagramWidget(N=ctrl.value, fnames=fnames, setnames=setnames).run();" ] }, {