From 13bd61ddb615e4f7c2b7f442da3f6b0372c97f67 Mon Sep 17 00:00:00 2001 From: a6a8e0f601822270ca754f29f77749b6 Date: Fri, 18 Sep 2020 13:09:13 +0000 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20du=20document.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module2/exo1/toy_notebook_fr.ipynb | 97 +++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 3 deletions(-) diff --git a/module2/exo1/toy_notebook_fr.ipynb b/module2/exo1/toy_notebook_fr.ipynb index 0bbbe37..5926d90 100644 --- a/module2/exo1/toy_notebook_fr.ipynb +++ b/module2/exo1/toy_notebook_fr.ipynb @@ -1,5 +1,97 @@ { - "cells": [], + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Document d'essai" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Completion sur noms de variables" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [], + "source": [ + "# En Python\n", + "Totoche = 25" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "25" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "Totoche" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "En Python, ça fonctionne." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The rpy2.ipython extension is already loaded. To reload it, use:\n", + " %reload_ext rpy2.ipython\n" + ] + }, + { + "ename": "NameError", + "evalue": "name 'plot' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 2\u001b[0m \u001b[0mget_ipython\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_line_magic\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'load_ext'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'rpy2.ipython'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m#%%R\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 4\u001b[0;31m \u001b[0mplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcars\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;31mNameError\u001b[0m: name 'plot' is not defined" + ] + } + ], + "source": [ + "# En R\n", + "%load_ext rpy2.ipython\n", + "%%R\n", + "plot(cars)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Problème pour exécuter du code R.\n", + "Tentative de résolution en exécutant la partie Python avec le kernel Python et la partie R avec le kernel R." + ] + } + ], "metadata": { "kernelspec": { "display_name": "Python 3", @@ -16,10 +108,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.3" + "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 2 } - -- 2.18.1