|
35 | 35 | "import numpy as np\n", |
36 | 36 | "import pandas as pd\n", |
37 | 37 | "\n", |
38 | | - "from utils import render\n", |
39 | | - "\n", |
40 | 38 | "users = pd.read_csv(os.path.join('data', 'users.csv'), index_col=0)\n", |
41 | 39 | "transactions = pd.read_csv(os.path.join('data', 'transactions.csv'), index_col=0)\n", |
42 | 40 | "# Pop out a quick sanity check\n", |
|
355 | 353 | "source": [ |
356 | 354 | "### Appending with [`DataFrame.append`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.append.html)\n", |
357 | 355 | "\n", |
358 | | - "There is a method on `DataFrame`s that allow a way to [`append`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.append.html) a new row to a new dataset. This returns a copy of the DataFrame with the new row(s) appended.\n", |
| 356 | + "The `DataFrame.append`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.append.html) method adds a new row to a new dataset. This method doesn't change the original dataset it returns a copy of the DataFrame with the new row(s) appended.\n", |
359 | 357 | "\n", |
360 | | - "The index for our **`transactions`** is auto assigned, so we'll set ths **`ignore_index`** keyword argument to `True`, so it gets generated.\n" |
| 358 | + "The index for our **`transactions`** is auto assigned, so we'll set the **`ignore_index`** keyword argument to `True`, so it gets generated.\n" |
361 | 359 | ] |
362 | 360 | }, |
363 | 361 | { |
|
811 | 809 | "## Renaming Columns\n", |
812 | 810 | "Renaming columns can be acheived using the [`DataFrame.rename`](https://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.rename.html) method. You specify the current name(s) as the key(s) and the new name(s) as the value(s).\n", |
813 | 811 | "\n", |
814 | | - "By default this returns a copy, but you can use the `inplace` command to change the existing `DataFrame`." |
| 812 | + "By default this returns a copy, but you can use the `inplace` parameter to change the existing `DataFrame`." |
815 | 813 | ] |
816 | 814 | }, |
817 | 815 | { |
|
923 | 921 | "source": [ |
924 | 922 | "## Deleting Columns\n", |
925 | 923 | "\n", |
926 | | - "In addition to slicing a `DataFrame` to simply not include a specific existing column. You can also drop columns by name.\n", |
927 | | - "\n", |
928 | | - "Let's remove the two that we added, in place." |
| 924 | + "In addition to slicing a `DataFrame` to simply not include a specific existing column. You can also drop columns by name. Let's remove the two that we added, in place." |
929 | 925 | ] |
930 | 926 | }, |
931 | 927 | { |
|
1029 | 1025 | "cell_type": "markdown", |
1030 | 1026 | "metadata": {}, |
1031 | 1027 | "source": [ |
1032 | | - "You might also seen this done using the `axis` parameter.\n", |
| 1028 | + "You might have seen this done before using the `axis` parameter.\n", |
1033 | 1029 | "\n", |
1034 | 1030 | "Let's get rid of the oddly named **`big_sender`** column. Why'd you let me name it that way?" |
1035 | 1031 | ] |
|
0 commit comments