GeezerVison is showing github.com — inplace ops update · SlayerLeon/python_reference@d2039a7
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: tutorials/things_in_pandas.ipynb +32-32Lines changed: 32 additions & 32 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "metadata": { | 3 | 3 | "name": "", | 4 | | - "signature": "sha256:cf7223086a74b13d1ae2228a4c8545c401765a90cdb3eca418f18138a4afdaab" | | 4 | + "signature": "sha256:2c7029e546d20c06eaa707f59d5b067689bf8827b87cc32f4fae7b55cde6e0f2" | 5 | 5 | }, | 6 | 6 | "nbformat": 3, | 7 | 7 | "nbformat_minor": 0, | | 29 | 29 | "output_type": "stream", | 30 | 30 | "stream": "stdout", | 31 | 31 | "text": [ | 32 | | - "Sebastian Raschka 24/01/2015 \n", | | 32 | + "Sebastian Raschka 25/01/2015 \n", | 33 | 33 | "\n", | 34 | 34 | "CPython 3.4.2\n", | 35 | 35 | "IPython 2.3.1\n", | | 890 | 890 | ], | 891 | 891 | "metadata": {}, | 892 | 892 | "output_type": "pyout", | 893 | | - "prompt_number": 8, | | 893 | + "prompt_number": 7, | 894 | 894 | "text": [ | 895 | 895 | " player salary games goals assists shots_on_target \\\n", | 896 | 896 | "7 Cesc F\u00e0bregas 14.0 20 2 14 10 \n", | | 904 | 904 | ] | 905 | 905 | } | 906 | 906 | ], | 907 | | - "prompt_number": 8 | | 907 | + "prompt_number": 7 | 908 | 908 | }, | 909 | 909 | { | 910 | 910 | "cell_type": "markdown", | | 1008 | 1008 | ], | 1009 | 1009 | "metadata": {}, | 1010 | 1010 | "output_type": "pyout", | 1011 | | - "prompt_number": 9, | | 1011 | + "prompt_number": 8, | 1012 | 1012 | "text": [ | 1013 | 1013 | " player salary games goals assists shots_on_target \\\n", | 1014 | 1014 | "4 \u00c1ngel Di Mar\u00eda 15.0 13 3 NaN 13 \n", | | 1020 | 1020 | ] | 1021 | 1021 | } | 1022 | 1022 | ], | 1023 | | - "prompt_number": 9 | | 1023 | + "prompt_number": 8 | 1024 | 1024 | }, | 1025 | 1025 | { | 1026 | 1026 | "cell_type": "markdown", | | 1177 | 1177 | ], | 1178 | 1178 | "metadata": {}, | 1179 | 1179 | "output_type": "pyout", | 1180 | | - "prompt_number": 10, | | 1180 | + "prompt_number": 9, | 1181 | 1181 | "text": [ | 1182 | 1182 | " player salary games goals assists shots_on_target \\\n", | 1183 | 1183 | "0 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", | | 1201 | 1201 | ] | 1202 | 1202 | } | 1203 | 1203 | ], | 1204 | | - "prompt_number": 10 | | 1204 | + "prompt_number": 9 | 1205 | 1205 | }, | 1206 | 1206 | { | 1207 | 1207 | "cell_type": "markdown", | | 1225 | 1225 | "input": [ | 1226 | 1226 | "# Filling NaN cells with default value 0\n", | 1227 | 1227 | "\n", | 1228 | | - "df = df.fillna(value=0)\n", | | 1228 | + "df.fillna(value=0, inplace=True)\n", | 1229 | 1229 | "df" | 1230 | 1230 | ], | 1231 | 1231 | "language": "python", | | 1387 | 1387 | ], | 1388 | 1388 | "metadata": {}, | 1389 | 1389 | "output_type": "pyout", | 1390 | | - "prompt_number": 11, | | 1390 | + "prompt_number": 10, | 1391 | 1391 | "text": [ | 1392 | 1392 | " player salary games goals assists shots_on_target \\\n", | 1393 | 1393 | "0 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", | | 1415 | 1415 | ] | 1416 | 1416 | } | 1417 | 1417 | ], | 1418 | | - "prompt_number": 11 | | 1418 | + "prompt_number": 10 | 1419 | 1419 | }, | 1420 | 1420 | { | 1421 | 1421 | "cell_type": "markdown", | | 1523 | 1523 | ], | 1524 | 1524 | "metadata": {}, | 1525 | 1525 | "output_type": "pyout", | 1526 | | - "prompt_number": 12, | | 1526 | + "prompt_number": 11, | 1527 | 1527 | "text": [ | 1528 | 1528 | " player salary games goals assists shots_on_target \\\n", | 1529 | 1529 | "8 Saido Berahino 13.8 21 9 0 20 \n", | | 1537 | 1537 | ] | 1538 | 1538 | } | 1539 | 1539 | ], | 1540 | | - "prompt_number": 12 | | 1540 | + "prompt_number": 11 | 1541 | 1541 | }, | 1542 | 1542 | { | 1543 | 1543 | "cell_type": "code", | | 1617 | 1617 | ], | 1618 | 1618 | "metadata": {}, | 1619 | 1619 | "output_type": "pyout", | 1620 | | - "prompt_number": 13, | | 1620 | + "prompt_number": 12, | 1621 | 1621 | "text": [ | 1622 | 1622 | " player salary games goals assists shots_on_target \\\n", | 1623 | 1623 | "8 Saido Berahino 13.8 21 9 0 20 \n", | | 1631 | 1631 | ] | 1632 | 1632 | } | 1633 | 1633 | ], | 1634 | | - "prompt_number": 13 | | 1634 | + "prompt_number": 12 | 1635 | 1635 | }, | 1636 | 1636 | { | 1637 | 1637 | "cell_type": "markdown", | | 1662 | 1662 | "input": [ | 1663 | 1663 | "# Sorting the DataFrame by a certain column (from highest to lowest)\n", | 1664 | 1664 | "\n", | 1665 | | - "df = df.sort('goals', ascending=False)\n", | | 1665 | + "df.sort('goals', ascending=False, inplace=True)\n", | 1666 | 1666 | "df.head()" | 1667 | 1667 | ], | 1668 | 1668 | "language": "python", | | 1759 | 1759 | ], | 1760 | 1760 | "metadata": {}, | 1761 | 1761 | "output_type": "pyout", | 1762 | | - "prompt_number": 14, | | 1762 | + "prompt_number": 13, | 1763 | 1763 | "text": [ | 1764 | 1764 | " player salary games goals assists shots_on_target \\\n", | 1765 | 1765 | "0 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", | | 1777 | 1777 | ] | 1778 | 1778 | } | 1779 | 1779 | ], | 1780 | | - "prompt_number": 14 | | 1780 | + "prompt_number": 13 | 1781 | 1781 | }, | 1782 | 1782 | { | 1783 | 1783 | "cell_type": "code", | | 1882 | 1882 | ], | 1883 | 1883 | "metadata": {}, | 1884 | 1884 | "output_type": "pyout", | 1885 | | - "prompt_number": 15, | | 1885 | + "prompt_number": 14, | 1886 | 1886 | "text": [ | 1887 | 1887 | " player salary games goals assists shots_on_target \\\n", | 1888 | 1888 | "1 Sergio Ag\u00fcero 19.2 16 14 3 34 \n", | | 1900 | 1900 | ] | 1901 | 1901 | } | 1902 | 1902 | ], | 1903 | | - "prompt_number": 15 | | 1903 | + "prompt_number": 14 | 1904 | 1904 | }, | 1905 | 1905 | { | 1906 | 1906 | "cell_type": "markdown", | | 2003 | 2003 | ], | 2004 | 2004 | "metadata": {}, | 2005 | 2005 | "output_type": "pyout", | 2006 | | - "prompt_number": 16, | | 2006 | + "prompt_number": 15, | 2007 | 2007 | "text": [ | 2008 | 2008 | " player salary games goals assists shots_on_target \\\n", | 2009 | 2009 | "1 Sergio Ag\u00fcero 20 16 14 3 34 \n", | | 2017 | 2017 | ] | 2018 | 2018 | } | 2019 | 2019 | ], | 2020 | | - "prompt_number": 16 | | 2020 | + "prompt_number": 15 | 2021 | 2021 | }, | 2022 | 2022 | { | 2023 | 2023 | "cell_type": "markdown", | | 2114 | 2114 | ], | 2115 | 2115 | "metadata": {}, | 2116 | 2116 | "output_type": "pyout", | 2117 | | - "prompt_number": 17, | | 2117 | + "prompt_number": 16, | 2118 | 2118 | "text": [ | 2119 | 2119 | " salary games goals assists shots_on_target \\\n", | 2120 | 2120 | "player \n", | | 2130 | 2130 | ] | 2131 | 2131 | } | 2132 | 2132 | ], | 2133 | | - "prompt_number": 17 | | 2133 | + "prompt_number": 16 | 2134 | 2134 | }, | 2135 | 2135 | { | 2136 | 2136 | "cell_type": "markdown", | | 2224 | 2224 | ], | 2225 | 2225 | "metadata": {}, | 2226 | 2226 | "output_type": "pyout", | 2227 | | - "prompt_number": 18, | | 2227 | + "prompt_number": 17, | 2228 | 2228 | "text": [ | 2229 | 2229 | " salary games goals assists shots_on_target \\\n", | 2230 | 2230 | "player \n", | | 2240 | 2240 | ] | 2241 | 2241 | } | 2242 | 2242 | ], | 2243 | | - "prompt_number": 18 | | 2243 | + "prompt_number": 17 | 2244 | 2244 | }, | 2245 | 2245 | { | 2246 | 2246 | "cell_type": "markdown", | | 2326 | 2326 | ], | 2327 | 2327 | "metadata": {}, | 2328 | 2328 | "output_type": "pyout", | 2329 | | - "prompt_number": 19, | | 2329 | + "prompt_number": 18, | 2330 | 2330 | "text": [ | 2331 | 2331 | " player salary games goals assists shots_on_target \\\n", | 2332 | 2332 | "0 Sergio Ag\u00fcero 20 16 14 3 34 \n", | | 2340 | 2340 | ] | 2341 | 2341 | } | 2342 | 2342 | ], | 2343 | | - "prompt_number": 19 | | 2343 | + "prompt_number": 18 | 2344 | 2344 | }, | 2345 | 2345 | { | 2346 | 2346 | "cell_type": "markdown", | | 2454 | 2454 | ], | 2455 | 2455 | "metadata": {}, | 2456 | 2456 | "output_type": "pyout", | 2457 | | - "prompt_number": 20, | | 2457 | + "prompt_number": 19, | 2458 | 2458 | "text": [ | 2459 | 2459 | " player salary games goals assists shots_on_target \\\n", | 2460 | 2460 | "1 Alexis S\u00e1nchez 15 0 12 7 29 \n", | | 2470 | 2470 | ] | 2471 | 2471 | } | 2472 | 2472 | ], | 2473 | | - "prompt_number": 20 | | 2473 | + "prompt_number": 19 | 2474 | 2474 | }, | 2475 | 2475 | { | 2476 | 2476 | "cell_type": "code", | | 2522 | 2522 | ], | 2523 | 2523 | "metadata": {}, | 2524 | 2524 | "output_type": "pyout", | 2525 | | - "prompt_number": 22, | | 2525 | + "prompt_number": 20, | 2526 | 2526 | "text": [ | 2527 | 2527 | " player salary games goals assists shots_on_target \\\n", | 2528 | 2528 | "1 Alexis S\u00e1nchez 15 0 12 7 29 \n", | | 2532 | 2532 | ] | 2533 | 2533 | } | 2534 | 2534 | ], | 2535 | | - "prompt_number": 22 | | 2535 | + "prompt_number": 20 | 2536 | 2536 | } | 2537 | 2537 | ], | 2538 | 2538 | "metadata": {} | |
|