From d2039a7868da12be7665d5349162d64af7ab4126 Mon Sep 17 00:00:00 2001 From: rasbt Date: Sun, 25 Jan 2015 00:10:54 -0500 Subject: [PATCH] inplace ops update --- tutorials/things_in_pandas.ipynb | 64 ++++++++++++++++---------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tutorials/things_in_pandas.ipynb b/tutorials/things_in_pandas.ipynb index bb71a69..7afa576 100644 --- a/tutorials/things_in_pandas.ipynb +++ b/tutorials/things_in_pandas.ipynb @@ -1,7 +1,7 @@ { "metadata": { "name": "", - "signature": "sha256:cf7223086a74b13d1ae2228a4c8545c401765a90cdb3eca418f18138a4afdaab" + "signature": "sha256:2c7029e546d20c06eaa707f59d5b067689bf8827b87cc32f4fae7b55cde6e0f2" }, "nbformat": 3, "nbformat_minor": 0, @@ -29,7 +29,7 @@ "output_type": "stream", "stream": "stdout", "text": [ - "Sebastian Raschka 24/01/2015 \n", + "Sebastian Raschka 25/01/2015 \n", "\n", "CPython 3.4.2\n", "IPython 2.3.1\n", @@ -890,7 +890,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 8, + "prompt_number": 7, "text": [ " player salary games goals assists shots_on_target \\\n", "7 Cesc F\u00e0bregas 14.0 20 2 14 10 \n", @@ -904,7 +904,7 @@ ] } ], - "prompt_number": 8 + "prompt_number": 7 }, { "cell_type": "markdown", @@ -1008,7 +1008,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 9, + "prompt_number": 8, "text": [ " player salary games goals assists shots_on_target \\\n", "4 \u00c1ngel Di Mar\u00eda 15.0 13 3 NaN 13 \n", @@ -1020,7 +1020,7 @@ ] } ], - "prompt_number": 9 + "prompt_number": 8 }, { "cell_type": "markdown", @@ -1177,7 +1177,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 10, + "prompt_number": 9, "text": [ " player salary games goals assists shots_on_target \\\n", "0 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", @@ -1201,7 +1201,7 @@ ] } ], - "prompt_number": 10 + "prompt_number": 9 }, { "cell_type": "markdown", @@ -1225,7 +1225,7 @@ "input": [ "# Filling NaN cells with default value 0\n", "\n", - "df = df.fillna(value=0)\n", + "df.fillna(value=0, inplace=True)\n", "df" ], "language": "python", @@ -1387,7 +1387,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 11, + "prompt_number": 10, "text": [ " player salary games goals assists shots_on_target \\\n", "0 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", @@ -1415,7 +1415,7 @@ ] } ], - "prompt_number": 11 + "prompt_number": 10 }, { "cell_type": "markdown", @@ -1523,7 +1523,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 12, + "prompt_number": 11, "text": [ " player salary games goals assists shots_on_target \\\n", "8 Saido Berahino 13.8 21 9 0 20 \n", @@ -1537,7 +1537,7 @@ ] } ], - "prompt_number": 12 + "prompt_number": 11 }, { "cell_type": "code", @@ -1617,7 +1617,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 13, + "prompt_number": 12, "text": [ " player salary games goals assists shots_on_target \\\n", "8 Saido Berahino 13.8 21 9 0 20 \n", @@ -1631,7 +1631,7 @@ ] } ], - "prompt_number": 13 + "prompt_number": 12 }, { "cell_type": "markdown", @@ -1662,7 +1662,7 @@ "input": [ "# Sorting the DataFrame by a certain column (from highest to lowest)\n", "\n", - "df = df.sort('goals', ascending=False)\n", + "df.sort('goals', ascending=False, inplace=True)\n", "df.head()" ], "language": "python", @@ -1759,7 +1759,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 14, + "prompt_number": 13, "text": [ " player salary games goals assists shots_on_target \\\n", "0 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", @@ -1777,7 +1777,7 @@ ] } ], - "prompt_number": 14 + "prompt_number": 13 }, { "cell_type": "code", @@ -1882,7 +1882,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 15, + "prompt_number": 14, "text": [ " player salary games goals assists shots_on_target \\\n", "1 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", @@ -1900,7 +1900,7 @@ ] } ], - "prompt_number": 15 + "prompt_number": 14 }, { "cell_type": "markdown", @@ -2003,7 +2003,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 16, + "prompt_number": 15, "text": [ " player salary games goals assists shots_on_target \\\n", "1 Sergio Ag\u00fcero 20 16 14 3 34 \n", @@ -2017,7 +2017,7 @@ ] } ], - "prompt_number": 16 + "prompt_number": 15 }, { "cell_type": "markdown", @@ -2114,7 +2114,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 17, + "prompt_number": 16, "text": [ " salary games goals assists shots_on_target \\\n", "player \n", @@ -2130,7 +2130,7 @@ ] } ], - "prompt_number": 17 + "prompt_number": 16 }, { "cell_type": "markdown", @@ -2224,7 +2224,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 18, + "prompt_number": 17, "text": [ " salary games goals assists shots_on_target \\\n", "player \n", @@ -2240,7 +2240,7 @@ ] } ], - "prompt_number": 18 + "prompt_number": 17 }, { "cell_type": "markdown", @@ -2326,7 +2326,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 19, + "prompt_number": 18, "text": [ " player salary games goals assists shots_on_target \\\n", "0 Sergio Ag\u00fcero 20 16 14 3 34 \n", @@ -2340,7 +2340,7 @@ ] } ], - "prompt_number": 19 + "prompt_number": 18 }, { "cell_type": "markdown", @@ -2454,7 +2454,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 20, + "prompt_number": 19, "text": [ " player salary games goals assists shots_on_target \\\n", "1 Alexis S\u00e1nchez 15 0 12 7 29 \n", @@ -2470,7 +2470,7 @@ ] } ], - "prompt_number": 20 + "prompt_number": 19 }, { "cell_type": "code", @@ -2522,7 +2522,7 @@ ], "metadata": {}, "output_type": "pyout", - "prompt_number": 22, + "prompt_number": 20, "text": [ " player salary games goals assists shots_on_target \\\n", "1 Alexis S\u00e1nchez 15 0 12 7 29 \n", @@ -2532,7 +2532,7 @@ ] } ], - "prompt_number": 22 + "prompt_number": 20 } ], "metadata": {}