From de27a4d4dc6c48870c51d295bb2e179777b33bca Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Mon, 12 Apr 2021 00:39:28 +0200 Subject: [PATCH] fixed python2 bugs --- 01-Python_Introduction/Python_Crash_Course.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/01-Python_Introduction/Python_Crash_Course.ipynb b/01-Python_Introduction/Python_Crash_Course.ipynb index 98cb630..13dbb12 100644 --- a/01-Python_Introduction/Python_Crash_Course.ipynb +++ b/01-Python_Introduction/Python_Crash_Course.ipynb @@ -85,7 +85,6 @@ "# Plots now appear in the notebook.\n", "%matplotlib inline \n", "\n", - "from __future__ import print_function, division # Python 2 and 3 are now very similar\n", "import matplotlib.pyplot as plt\n", "plt.style.use('ggplot') # Matplotlib style sheet - nicer plots!\n", "plt.rcParams['figure.figsize'] = 12, 8 # Slightly bigger plots by default" @@ -587,7 +586,7 @@ "import numpy as np\n", "\n", "# Create a large array with with 1 million samples.\n", - "x = np.linspace(start=0, stop=100, num=1E6, dtype=np.float64)\n", + "x = np.linspace(start=0, stop=100, num=int(1E6), dtype=np.float64)\n", "\n", "# Most operations work per-element.\n", "y = x ** 2\n", @@ -769,4 +768,4 @@ }, "nbformat": 4, "nbformat_minor": 0 -} +} \ No newline at end of file -- 2.45.2