|
37 | 37 | "transactions = pd.read_csv(os.path.join('data', 'transactions.csv'), index_col=0)\n",
|
38 | 38 | "requests = pd.read_csv(os.path.join('data', 'requests.csv'), index_col=0)\n",
|
39 | 39 | "\n",
|
40 |
| - "# Perform the merge from the previous notebook (s2n6-combining-dataframes.ipynb)\n", |
| 40 | + "# Perform the merge from the previous notebook \n", |
| 41 | + "# (s2n06-combining-dataframes.ipynb)\n", |
41 | 42 | "successful_requests = requests.merge(\n",
|
42 | 43 | " transactions,\n",
|
43 | 44 | " left_on=['from_user', 'to_user', 'amount'], \n",
|
|
84 | 85 | "# Let's get our records sorted chronologically\n",
|
85 | 86 | "successful_requests.sort_values('request_date', inplace=True) \n",
|
86 | 87 | "\n",
|
87 |
| - "# And then we'll drop dupes keeping only the last one. Note the call to inplace \n", |
| 88 | + "# And then we'll drop dupes keeping only the last one. \n", |
| 89 | + "# Note the use of the inplace keyword\n", |
88 | 90 | "successful_requests.drop_duplicates(('from_user', 'to_user', 'amount'), keep='last', inplace=True)\n",
|
89 | 91 | "\n",
|
90 | 92 | "# Statement from previous notebook\n",
|
|
226 | 228 | }
|
227 | 229 | ],
|
228 | 230 | "source": [
|
229 |
| - "# Create a boolean array where we check to see if the label (username) is in the `from_user` Series.\n", |
| 231 | + "# Create a boolean array where we check to see if the label (username) \n", |
| 232 | + "# is in the `from_user` Series.\n", |
230 | 233 | "made_request_index = users.index.isin(requests.from_user)\n",
|
231 | 234 | "# This will get us a list of all users who **have** made a request\n",
|
232 | 235 | "users[made_request_index].head()"
|
|
0 commit comments