From aee80d6734a3cc7ce7182611f4c995c92a7ef417 Mon Sep 17 00:00:00 2001 From: Ankit Gupta Date: Wed, 6 Apr 2022 15:55:33 +0530 Subject: [PATCH] Kaggle Notebook | Pandas - 6 Exercise: Renaming and Combining | Version 1 --- pandas-6-exercise-renaming-and-combining.ipynb | 1 + 1 file changed, 1 insertion(+) create mode 100644 pandas-6-exercise-renaming-and-combining.ipynb diff --git a/pandas-6-exercise-renaming-and-combining.ipynb b/pandas-6-exercise-renaming-and-combining.ipynb new file mode 100644 index 0000000..2cecef2 --- /dev/null +++ b/pandas-6-exercise-renaming-and-combining.ipynb @@ -0,0 +1 @@ +{"cells":[{"source":"\"Kaggle\"","metadata":{},"cell_type":"markdown","outputs":[],"execution_count":0},{"cell_type":"markdown","id":"cb6d4c7c","metadata":{"papermill":{"duration":0.02109,"end_time":"2022-04-06T10:25:10.134638","exception":false,"start_time":"2022-04-06T10:25:10.113548","status":"completed"},"tags":[]},"source":["**This notebook is an exercise in the [Pandas](https://www.kaggle.com/learn/pandas) course. You can reference the tutorial at [this link](https://www.kaggle.com/residentmario/renaming-and-combining).**\n","\n","---\n"]},{"cell_type":"markdown","id":"2eb15a8a","metadata":{"papermill":{"duration":0.019181,"end_time":"2022-04-06T10:25:10.175441","exception":false,"start_time":"2022-04-06T10:25:10.15626","status":"completed"},"tags":[]},"source":["# Introduction\n","\n","Run the following cell to load your data and some utility functions."]},{"cell_type":"code","execution_count":1,"id":"5f774a12","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:10.225835Z","iopub.status.busy":"2022-04-06T10:25:10.225075Z","iopub.status.idle":"2022-04-06T10:25:14.509855Z","shell.execute_reply":"2022-04-06T10:25:14.510764Z","shell.execute_reply.started":"2022-04-06T10:23:02.058068Z"},"papermill":{"duration":4.31603,"end_time":"2022-04-06T10:25:14.511231","exception":false,"start_time":"2022-04-06T10:25:10.195201","status":"completed"},"tags":[]},"outputs":[{"name":"stdout","output_type":"stream","text":["Setup complete.\n"]}],"source":["import pandas as pd\n","\n","reviews = pd.read_csv(\"../input/wine-reviews/winemag-data-130k-v2.csv\", index_col=0)\n","\n","from learntools.core import binder; binder.bind(globals())\n","from learntools.pandas.renaming_and_combining import *\n","print(\"Setup complete.\")"]},{"cell_type":"markdown","id":"9cb7d6d1","metadata":{"papermill":{"duration":0.02025,"end_time":"2022-04-06T10:25:14.552981","exception":false,"start_time":"2022-04-06T10:25:14.532731","status":"completed"},"tags":[]},"source":["# Exercises\n","\n","View the first several lines of your data by running the cell below:"]},{"cell_type":"code","execution_count":2,"id":"d923e9f3","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:14.60139Z","iopub.status.busy":"2022-04-06T10:25:14.600363Z","iopub.status.idle":"2022-04-06T10:25:14.621133Z","shell.execute_reply":"2022-04-06T10:25:14.621659Z","shell.execute_reply.started":"2022-04-06T10:23:03.085578Z"},"papermill":{"duration":0.048766,"end_time":"2022-04-06T10:25:14.621835","exception":false,"start_time":"2022-04-06T10:25:14.573069","status":"completed"},"tags":[]},"outputs":[{"data":{"text/html":["
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
countrydescriptiondesignationpointspriceprovinceregion_1region_2taster_nametaster_twitter_handletitlevarietywinery
0ItalyAromas include tropical fruit, broom, brimston...Vulkà Bianco87NaNSicily & SardiniaEtnaNaNKerin O’Keefe@kerinokeefeNicosia 2013 Vulkà Bianco (Etna)White BlendNicosia
1PortugalThis is ripe and fruity, a wine that is smooth...Avidagos8715.0DouroNaNNaNRoger Voss@vossrogerQuinta dos Avidagos 2011 Avidagos Red (Douro)Portuguese RedQuinta dos Avidagos
2USTart and snappy, the flavors of lime flesh and...NaN8714.0OregonWillamette ValleyWillamette ValleyPaul Gregutt@paulgwineRainstorm 2013 Pinot Gris (Willamette Valley)Pinot GrisRainstorm
3USPineapple rind, lemon pith and orange blossom ...Reserve Late Harvest8713.0MichiganLake Michigan ShoreNaNAlexander PeartreeNaNSt. Julian 2013 Reserve Late Harvest Riesling ...RieslingSt. Julian
4USMuch like the regular bottling from 2012, this...Vintner's Reserve Wild Child Block8765.0OregonWillamette ValleyWillamette ValleyPaul Gregutt@paulgwineSweet Cheeks 2012 Vintner's Reserve Wild Child...Pinot NoirSweet Cheeks
\n","
"],"text/plain":[" country description \\\n","0 Italy Aromas include tropical fruit, broom, brimston... \n","1 Portugal This is ripe and fruity, a wine that is smooth... \n","2 US Tart and snappy, the flavors of lime flesh and... \n","3 US Pineapple rind, lemon pith and orange blossom ... \n","4 US Much like the regular bottling from 2012, this... \n","\n"," designation points price province \\\n","0 Vulkà Bianco 87 NaN Sicily & Sardinia \n","1 Avidagos 87 15.0 Douro \n","2 NaN 87 14.0 Oregon \n","3 Reserve Late Harvest 87 13.0 Michigan \n","4 Vintner's Reserve Wild Child Block 87 65.0 Oregon \n","\n"," region_1 region_2 taster_name \\\n","0 Etna NaN Kerin O’Keefe \n","1 NaN NaN Roger Voss \n","2 Willamette Valley Willamette Valley Paul Gregutt \n","3 Lake Michigan Shore NaN Alexander Peartree \n","4 Willamette Valley Willamette Valley Paul Gregutt \n","\n"," taster_twitter_handle title \\\n","0 @kerinokeefe Nicosia 2013 Vulkà Bianco (Etna) \n","1 @vossroger Quinta dos Avidagos 2011 Avidagos Red (Douro) \n","2 @paulgwine  Rainstorm 2013 Pinot Gris (Willamette Valley) \n","3 NaN St. Julian 2013 Reserve Late Harvest Riesling ... \n","4 @paulgwine  Sweet Cheeks 2012 Vintner's Reserve Wild Child... \n","\n"," variety winery \n","0 White Blend Nicosia \n","1 Portuguese Red Quinta dos Avidagos \n","2 Pinot Gris Rainstorm \n","3 Riesling St. Julian \n","4 Pinot Noir Sweet Cheeks "]},"execution_count":2,"metadata":{},"output_type":"execute_result"}],"source":["reviews.head()"]},{"cell_type":"markdown","id":"9d418b9a","metadata":{"papermill":{"duration":0.02036,"end_time":"2022-04-06T10:25:14.664108","exception":false,"start_time":"2022-04-06T10:25:14.643748","status":"completed"},"tags":[]},"source":["## 1.\n","`region_1` and `region_2` are pretty uninformative names for locale columns in the dataset. Create a copy of `reviews` with these columns renamed to `region` and `locale`, respectively."]},{"cell_type":"code","execution_count":3,"id":"82158a91","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:14.711561Z","iopub.status.busy":"2022-04-06T10:25:14.710844Z","iopub.status.idle":"2022-04-06T10:25:14.760963Z","shell.execute_reply":"2022-04-06T10:25:14.760414Z","shell.execute_reply.started":"2022-04-06T10:23:03.108403Z"},"papermill":{"duration":0.075857,"end_time":"2022-04-06T10:25:14.761152","exception":false,"start_time":"2022-04-06T10:25:14.685295","status":"completed"},"tags":[]},"outputs":[{"data":{"application/javascript":["parent.postMessage({\"jupyterEvent\": \"custom.exercise_interaction\", \"data\": {\"outcomeType\": 1, \"valueTowardsCompletion\": 0.25, \"interactionType\": 1, \"questionType\": 1, \"questionId\": \"1_RenameCols\", \"learnToolsVersion\": \"0.3.4\", \"failureMessage\": \"\", \"exceptionClass\": \"\", \"trace\": \"\"}}, \"*\")"],"text/plain":[""]},"metadata":{},"output_type":"display_data"},{"data":{"text/markdown":["Correct"],"text/plain":["Correct"]},"metadata":{},"output_type":"display_data"},{"data":{"text/html":["
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
countrydescriptiondesignationpointspriceprovinceregionlocaletaster_nametaster_twitter_handletitlevarietywinery
0ItalyAromas include tropical fruit, broom, brimston...Vulkà Bianco87NaNSicily & SardiniaEtnaNaNKerin O’Keefe@kerinokeefeNicosia 2013 Vulkà Bianco (Etna)White BlendNicosia
1PortugalThis is ripe and fruity, a wine that is smooth...Avidagos8715.0DouroNaNNaNRoger Voss@vossrogerQuinta dos Avidagos 2011 Avidagos Red (Douro)Portuguese RedQuinta dos Avidagos
2USTart and snappy, the flavors of lime flesh and...NaN8714.0OregonWillamette ValleyWillamette ValleyPaul Gregutt@paulgwineRainstorm 2013 Pinot Gris (Willamette Valley)Pinot GrisRainstorm
3USPineapple rind, lemon pith and orange blossom ...Reserve Late Harvest8713.0MichiganLake Michigan ShoreNaNAlexander PeartreeNaNSt. Julian 2013 Reserve Late Harvest Riesling ...RieslingSt. Julian
4USMuch like the regular bottling from 2012, this...Vintner's Reserve Wild Child Block8765.0OregonWillamette ValleyWillamette ValleyPaul Gregutt@paulgwineSweet Cheeks 2012 Vintner's Reserve Wild Child...Pinot NoirSweet Cheeks
..........................................
129966GermanyNotes of honeysuckle and cantaloupe sweeten th...Brauneberger Juffer-Sonnenuhr Spätlese9028.0MoselNaNNaNAnna Lee C. IijimaNaNDr. H. Thanisch (Erben Müller-Burggraef) 2013 ...RieslingDr. H. Thanisch (Erben Müller-Burggraef)
129967USCitation is given as much as a decade of bottl...NaN9075.0OregonOregonOregon OtherPaul Gregutt@paulgwineCitation 2004 Pinot Noir (Oregon)Pinot NoirCitation
129968FranceWell-drained gravel soil gives this wine its c...Kritt9030.0AlsaceAlsaceNaNRoger Voss@vossrogerDomaine Gresser 2013 Kritt Gewurztraminer (Als...GewürztraminerDomaine Gresser
129969FranceA dry style of Pinot Gris, this is crisp with ...NaN9032.0AlsaceAlsaceNaNRoger Voss@vossrogerDomaine Marcel Deiss 2012 Pinot Gris (Alsace)Pinot GrisDomaine Marcel Deiss
129970FranceBig, rich and off-dry, this is powered by inte...Lieu-dit Harth Cuvée Caroline9021.0AlsaceAlsaceNaNRoger Voss@vossrogerDomaine Schoffit 2012 Lieu-dit Harth Cuvée Car...GewürztraminerDomaine Schoffit
\n","

129971 rows × 13 columns

\n","
"],"text/plain":[" country description \\\n","0 Italy Aromas include tropical fruit, broom, brimston... \n","1 Portugal This is ripe and fruity, a wine that is smooth... \n","2 US Tart and snappy, the flavors of lime flesh and... \n","3 US Pineapple rind, lemon pith and orange blossom ... \n","4 US Much like the regular bottling from 2012, this... \n","... ... ... \n","129966 Germany Notes of honeysuckle and cantaloupe sweeten th... \n","129967 US Citation is given as much as a decade of bottl... \n","129968 France Well-drained gravel soil gives this wine its c... \n","129969 France A dry style of Pinot Gris, this is crisp with ... \n","129970 France Big, rich and off-dry, this is powered by inte... \n","\n"," designation points price \\\n","0 Vulkà Bianco 87 NaN \n","1 Avidagos 87 15.0 \n","2 NaN 87 14.0 \n","3 Reserve Late Harvest 87 13.0 \n","4 Vintner's Reserve Wild Child Block 87 65.0 \n","... ... ... ... \n","129966 Brauneberger Juffer-Sonnenuhr Spätlese 90 28.0 \n","129967 NaN 90 75.0 \n","129968 Kritt 90 30.0 \n","129969 NaN 90 32.0 \n","129970 Lieu-dit Harth Cuvée Caroline 90 21.0 \n","\n"," province region locale \\\n","0 Sicily & Sardinia Etna NaN \n","1 Douro NaN NaN \n","2 Oregon Willamette Valley Willamette Valley \n","3 Michigan Lake Michigan Shore NaN \n","4 Oregon Willamette Valley Willamette Valley \n","... ... ... ... \n","129966 Mosel NaN NaN \n","129967 Oregon Oregon Oregon Other \n","129968 Alsace Alsace NaN \n","129969 Alsace Alsace NaN \n","129970 Alsace Alsace NaN \n","\n"," taster_name taster_twitter_handle \\\n","0 Kerin O’Keefe @kerinokeefe \n","1 Roger Voss @vossroger \n","2 Paul Gregutt @paulgwine  \n","3 Alexander Peartree NaN \n","4 Paul Gregutt @paulgwine  \n","... ... ... \n","129966 Anna Lee C. Iijima NaN \n","129967 Paul Gregutt @paulgwine  \n","129968 Roger Voss @vossroger \n","129969 Roger Voss @vossroger \n","129970 Roger Voss @vossroger \n","\n"," title variety \\\n","0 Nicosia 2013 Vulkà Bianco (Etna) White Blend \n","1 Quinta dos Avidagos 2011 Avidagos Red (Douro) Portuguese Red \n","2 Rainstorm 2013 Pinot Gris (Willamette Valley) Pinot Gris \n","3 St. Julian 2013 Reserve Late Harvest Riesling ... Riesling \n","4 Sweet Cheeks 2012 Vintner's Reserve Wild Child... Pinot Noir \n","... ... ... \n","129966 Dr. H. Thanisch (Erben Müller-Burggraef) 2013 ... Riesling \n","129967 Citation 2004 Pinot Noir (Oregon) Pinot Noir \n","129968 Domaine Gresser 2013 Kritt Gewurztraminer (Als... Gewürztraminer \n","129969 Domaine Marcel Deiss 2012 Pinot Gris (Alsace) Pinot Gris \n","129970 Domaine Schoffit 2012 Lieu-dit Harth Cuvée Car... Gewürztraminer \n","\n"," winery \n","0 Nicosia \n","1 Quinta dos Avidagos \n","2 Rainstorm \n","3 St. Julian \n","4 Sweet Cheeks \n","... ... \n","129966 Dr. H. Thanisch (Erben Müller-Burggraef) \n","129967 Citation \n","129968 Domaine Gresser \n","129969 Domaine Marcel Deiss \n","129970 Domaine Schoffit \n","\n","[129971 rows x 13 columns]"]},"execution_count":3,"metadata":{},"output_type":"execute_result"}],"source":["# Your code here\n","renamed = reviews.rename(columns={'region_1':'region','region_2':'locale'})\n","\n","# Check your answer\n","q1.check()\n","renamed"]},{"cell_type":"code","execution_count":4,"id":"ec9f9fa6","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:14.811615Z","iopub.status.busy":"2022-04-06T10:25:14.810951Z","iopub.status.idle":"2022-04-06T10:25:14.813812Z","shell.execute_reply":"2022-04-06T10:25:14.81315Z","shell.execute_reply.started":"2022-04-06T10:23:03.149776Z"},"papermill":{"duration":0.029426,"end_time":"2022-04-06T10:25:14.813956","exception":false,"start_time":"2022-04-06T10:25:14.78453","status":"completed"},"tags":[]},"outputs":[],"source":["#q1.hint()\n","#q1.solution()"]},{"cell_type":"markdown","id":"21c63f89","metadata":{"papermill":{"duration":0.022527,"end_time":"2022-04-06T10:25:14.859376","exception":false,"start_time":"2022-04-06T10:25:14.836849","status":"completed"},"tags":[]},"source":["## 2.\n","Set the index name in the dataset to `wines`."]},{"cell_type":"code","execution_count":5,"id":"b59d2d88","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:14.911499Z","iopub.status.busy":"2022-04-06T10:25:14.910432Z","iopub.status.idle":"2022-04-06T10:25:14.959781Z","shell.execute_reply":"2022-04-06T10:25:14.960309Z","shell.execute_reply.started":"2022-04-06T10:23:03.155685Z"},"papermill":{"duration":0.078227,"end_time":"2022-04-06T10:25:14.960487","exception":false,"start_time":"2022-04-06T10:25:14.88226","status":"completed"},"tags":[]},"outputs":[{"data":{"application/javascript":["parent.postMessage({\"jupyterEvent\": \"custom.exercise_interaction\", \"data\": {\"outcomeType\": 1, \"valueTowardsCompletion\": 0.25, \"interactionType\": 1, \"questionType\": 1, \"questionId\": \"2_RenameIndex\", \"learnToolsVersion\": \"0.3.4\", \"failureMessage\": \"\", \"exceptionClass\": \"\", \"trace\": \"\"}}, \"*\")"],"text/plain":[""]},"metadata":{},"output_type":"display_data"},{"data":{"text/markdown":["Correct"],"text/plain":["Correct"]},"metadata":{},"output_type":"display_data"},{"data":{"text/html":["
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
countrydescriptiondesignationpointspriceprovinceregion_1region_2taster_nametaster_twitter_handletitlevarietywinery
wines
0ItalyAromas include tropical fruit, broom, brimston...Vulkà Bianco87NaNSicily & SardiniaEtnaNaNKerin O’Keefe@kerinokeefeNicosia 2013 Vulkà Bianco (Etna)White BlendNicosia
1PortugalThis is ripe and fruity, a wine that is smooth...Avidagos8715.0DouroNaNNaNRoger Voss@vossrogerQuinta dos Avidagos 2011 Avidagos Red (Douro)Portuguese RedQuinta dos Avidagos
2USTart and snappy, the flavors of lime flesh and...NaN8714.0OregonWillamette ValleyWillamette ValleyPaul Gregutt@paulgwineRainstorm 2013 Pinot Gris (Willamette Valley)Pinot GrisRainstorm
3USPineapple rind, lemon pith and orange blossom ...Reserve Late Harvest8713.0MichiganLake Michigan ShoreNaNAlexander PeartreeNaNSt. Julian 2013 Reserve Late Harvest Riesling ...RieslingSt. Julian
4USMuch like the regular bottling from 2012, this...Vintner's Reserve Wild Child Block8765.0OregonWillamette ValleyWillamette ValleyPaul Gregutt@paulgwineSweet Cheeks 2012 Vintner's Reserve Wild Child...Pinot NoirSweet Cheeks
..........................................
129966GermanyNotes of honeysuckle and cantaloupe sweeten th...Brauneberger Juffer-Sonnenuhr Spätlese9028.0MoselNaNNaNAnna Lee C. IijimaNaNDr. H. Thanisch (Erben Müller-Burggraef) 2013 ...RieslingDr. H. Thanisch (Erben Müller-Burggraef)
129967USCitation is given as much as a decade of bottl...NaN9075.0OregonOregonOregon OtherPaul Gregutt@paulgwineCitation 2004 Pinot Noir (Oregon)Pinot NoirCitation
129968FranceWell-drained gravel soil gives this wine its c...Kritt9030.0AlsaceAlsaceNaNRoger Voss@vossrogerDomaine Gresser 2013 Kritt Gewurztraminer (Als...GewürztraminerDomaine Gresser
129969FranceA dry style of Pinot Gris, this is crisp with ...NaN9032.0AlsaceAlsaceNaNRoger Voss@vossrogerDomaine Marcel Deiss 2012 Pinot Gris (Alsace)Pinot GrisDomaine Marcel Deiss
129970FranceBig, rich and off-dry, this is powered by inte...Lieu-dit Harth Cuvée Caroline9021.0AlsaceAlsaceNaNRoger Voss@vossrogerDomaine Schoffit 2012 Lieu-dit Harth Cuvée Car...GewürztraminerDomaine Schoffit
\n","

129971 rows × 13 columns

\n","
"],"text/plain":[" country description \\\n","wines \n","0 Italy Aromas include tropical fruit, broom, brimston... \n","1 Portugal This is ripe and fruity, a wine that is smooth... \n","2 US Tart and snappy, the flavors of lime flesh and... \n","3 US Pineapple rind, lemon pith and orange blossom ... \n","4 US Much like the regular bottling from 2012, this... \n","... ... ... \n","129966 Germany Notes of honeysuckle and cantaloupe sweeten th... \n","129967 US Citation is given as much as a decade of bottl... \n","129968 France Well-drained gravel soil gives this wine its c... \n","129969 France A dry style of Pinot Gris, this is crisp with ... \n","129970 France Big, rich and off-dry, this is powered by inte... \n","\n"," designation points price \\\n","wines \n","0 Vulkà Bianco 87 NaN \n","1 Avidagos 87 15.0 \n","2 NaN 87 14.0 \n","3 Reserve Late Harvest 87 13.0 \n","4 Vintner's Reserve Wild Child Block 87 65.0 \n","... ... ... ... \n","129966 Brauneberger Juffer-Sonnenuhr Spätlese 90 28.0 \n","129967 NaN 90 75.0 \n","129968 Kritt 90 30.0 \n","129969 NaN 90 32.0 \n","129970 Lieu-dit Harth Cuvée Caroline 90 21.0 \n","\n"," province region_1 region_2 \\\n","wines \n","0 Sicily & Sardinia Etna NaN \n","1 Douro NaN NaN \n","2 Oregon Willamette Valley Willamette Valley \n","3 Michigan Lake Michigan Shore NaN \n","4 Oregon Willamette Valley Willamette Valley \n","... ... ... ... \n","129966 Mosel NaN NaN \n","129967 Oregon Oregon Oregon Other \n","129968 Alsace Alsace NaN \n","129969 Alsace Alsace NaN \n","129970 Alsace Alsace NaN \n","\n"," taster_name taster_twitter_handle \\\n","wines \n","0 Kerin O’Keefe @kerinokeefe \n","1 Roger Voss @vossroger \n","2 Paul Gregutt @paulgwine  \n","3 Alexander Peartree NaN \n","4 Paul Gregutt @paulgwine  \n","... ... ... \n","129966 Anna Lee C. Iijima NaN \n","129967 Paul Gregutt @paulgwine  \n","129968 Roger Voss @vossroger \n","129969 Roger Voss @vossroger \n","129970 Roger Voss @vossroger \n","\n"," title variety \\\n","wines \n","0 Nicosia 2013 Vulkà Bianco (Etna) White Blend \n","1 Quinta dos Avidagos 2011 Avidagos Red (Douro) Portuguese Red \n","2 Rainstorm 2013 Pinot Gris (Willamette Valley) Pinot Gris \n","3 St. Julian 2013 Reserve Late Harvest Riesling ... Riesling \n","4 Sweet Cheeks 2012 Vintner's Reserve Wild Child... Pinot Noir \n","... ... ... \n","129966 Dr. H. Thanisch (Erben Müller-Burggraef) 2013 ... Riesling \n","129967 Citation 2004 Pinot Noir (Oregon) Pinot Noir \n","129968 Domaine Gresser 2013 Kritt Gewurztraminer (Als... Gewürztraminer \n","129969 Domaine Marcel Deiss 2012 Pinot Gris (Alsace) Pinot Gris \n","129970 Domaine Schoffit 2012 Lieu-dit Harth Cuvée Car... Gewürztraminer \n","\n"," winery \n","wines \n","0 Nicosia \n","1 Quinta dos Avidagos \n","2 Rainstorm \n","3 St. Julian \n","4 Sweet Cheeks \n","... ... \n","129966 Dr. H. Thanisch (Erben Müller-Burggraef) \n","129967 Citation \n","129968 Domaine Gresser \n","129969 Domaine Marcel Deiss \n","129970 Domaine Schoffit \n","\n","[129971 rows x 13 columns]"]},"execution_count":5,"metadata":{},"output_type":"execute_result"}],"source":["reindexed = reviews.rename_axis('wines', axis= 'rows')\n","\n","# Check your answer\n","q2.check()\n","reindexed"]},{"cell_type":"code","execution_count":6,"id":"44ad3be7","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:15.014776Z","iopub.status.busy":"2022-04-06T10:25:15.013797Z","iopub.status.idle":"2022-04-06T10:25:15.017097Z","shell.execute_reply":"2022-04-06T10:25:15.017629Z","shell.execute_reply.started":"2022-04-06T10:23:03.204821Z"},"papermill":{"duration":0.032194,"end_time":"2022-04-06T10:25:15.017802","exception":false,"start_time":"2022-04-06T10:25:14.985608","status":"completed"},"tags":[]},"outputs":[],"source":["#q2.hint()\n","#q2.solution()"]},{"cell_type":"markdown","id":"0bc6c98e","metadata":{"papermill":{"duration":0.025108,"end_time":"2022-04-06T10:25:15.068582","exception":false,"start_time":"2022-04-06T10:25:15.043474","status":"completed"},"tags":[]},"source":["## 3.\n","The [Things on Reddit](https://www.kaggle.com/residentmario/things-on-reddit/data) dataset includes product links from a selection of top-ranked forums (\"subreddits\") on reddit.com. Run the cell below to load a dataframe of products mentioned on the */r/gaming* subreddit and another dataframe for products mentioned on the *r//movies* subreddit."]},{"cell_type":"code","execution_count":7,"id":"9169ca31","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:15.122993Z","iopub.status.busy":"2022-04-06T10:25:15.121887Z","iopub.status.idle":"2022-04-06T10:25:15.137282Z","shell.execute_reply":"2022-04-06T10:25:15.137842Z","shell.execute_reply.started":"2022-04-06T10:23:03.211973Z"},"papermill":{"duration":0.04436,"end_time":"2022-04-06T10:25:15.138019","exception":false,"start_time":"2022-04-06T10:25:15.093659","status":"completed"},"tags":[]},"outputs":[],"source":["gaming_products = pd.read_csv(\"../input/things-on-reddit/top-things/top-things/reddits/g/gaming.csv\")\n","gaming_products['subreddit'] = \"r/gaming\"\n","movie_products = pd.read_csv(\"../input/things-on-reddit/top-things/top-things/reddits/m/movies.csv\")\n","movie_products['subreddit'] = \"r/movies\""]},{"cell_type":"markdown","id":"d5e07d88","metadata":{"papermill":{"duration":0.025694,"end_time":"2022-04-06T10:25:15.189654","exception":false,"start_time":"2022-04-06T10:25:15.16396","status":"completed"},"tags":[]},"source":["Create a `DataFrame` of products mentioned on *either* subreddit."]},{"cell_type":"code","execution_count":8,"id":"b2e65c48","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:15.244121Z","iopub.status.busy":"2022-04-06T10:25:15.243093Z","iopub.status.idle":"2022-04-06T10:25:15.269243Z","shell.execute_reply":"2022-04-06T10:25:15.269732Z","shell.execute_reply.started":"2022-04-06T10:23:03.238662Z"},"papermill":{"duration":0.055157,"end_time":"2022-04-06T10:25:15.26991","exception":false,"start_time":"2022-04-06T10:25:15.214753","status":"completed"},"tags":[]},"outputs":[{"data":{"application/javascript":["parent.postMessage({\"jupyterEvent\": \"custom.exercise_interaction\", \"data\": {\"outcomeType\": 1, \"valueTowardsCompletion\": 0.25, \"interactionType\": 1, \"questionType\": 2, \"questionId\": \"3_ConcatReddit\", \"learnToolsVersion\": \"0.3.4\", \"failureMessage\": \"\", \"exceptionClass\": \"\", \"trace\": \"\"}}, \"*\")"],"text/plain":[""]},"metadata":{},"output_type":"display_data"},{"data":{"text/markdown":["Correct"],"text/plain":["Correct"]},"metadata":{},"output_type":"display_data"},{"data":{"text/html":["
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
namecategoryamazon_linktotal_mentionssubreddit_mentionssubreddit
0BOOMco Halo Covenant Needler BlasterToys & Gameshttps://www.amazon.com/BOOMco-Halo-Covenant-Ne...4.04r/gaming
1Raspberry PI 3 Model B 1.2GHz 64-bit quad-core...Electronicshttps://www.amazon.com/Raspberry-Model-A1-2GHz...19.03r/gaming
2CanaKit 5V 2.5A Raspberry Pi 3 Power Supply / ...Electronicshttps://www.amazon.com/CanaKit-Raspberry-Suppl...7.03r/gaming
3Panasonic K-KJ17MCA4BA Advanced Individual Cel...Electronicshttps://www.amazon.com/Panasonic-Advanced-Indi...29.02r/gaming
4Mayflash GameCube Controller Adapter for Wii U...Electronicshttps://www.amazon.com/GameCube-Controller-Ada...24.02r/gaming
.....................
298Welcome to Night Vale CD: A NovelBookshttps://www.amazon.com/Welcome-Night-Vale-CD-N...1.01r/movies
299Ran (StudioCanal Collection) [Blu-ray]Movies & TVhttps://www.amazon.com/StudioCanal-Collection-...1.01r/movies
300The Art of John AlvinBookshttps://www.amazon.com/Art-John-Alvin-Andrea/d...1.01r/movies
301Apocalypto [Blu-ray]Movies & TVhttps://www.amazon.com/Apocalypto-Blu-ray-Rudy...1.01r/movies
302Cinelinx: A Card Game for People Who Love Movi...Toys & Gameshttps://www.amazon.com/Cinelinx-Card-Game-Peop...1.01r/movies
\n","

796 rows × 6 columns

\n","
"],"text/plain":[" name category \\\n","0 BOOMco Halo Covenant Needler Blaster Toys & Games \n","1 Raspberry PI 3 Model B 1.2GHz 64-bit quad-core... Electronics \n","2 CanaKit 5V 2.5A Raspberry Pi 3 Power Supply / ... Electronics \n","3 Panasonic K-KJ17MCA4BA Advanced Individual Cel... Electronics \n","4 Mayflash GameCube Controller Adapter for Wii U... Electronics \n",".. ... ... \n","298 Welcome to Night Vale CD: A Novel Books \n","299 Ran (StudioCanal Collection) [Blu-ray] Movies & TV \n","300 The Art of John Alvin Books \n","301 Apocalypto [Blu-ray] Movies & TV \n","302 Cinelinx: A Card Game for People Who Love Movi... Toys & Games \n","\n"," amazon_link total_mentions \\\n","0 https://www.amazon.com/BOOMco-Halo-Covenant-Ne... 4.0 \n","1 https://www.amazon.com/Raspberry-Model-A1-2GHz... 19.0 \n","2 https://www.amazon.com/CanaKit-Raspberry-Suppl... 7.0 \n","3 https://www.amazon.com/Panasonic-Advanced-Indi... 29.0 \n","4 https://www.amazon.com/GameCube-Controller-Ada... 24.0 \n",".. ... ... \n","298 https://www.amazon.com/Welcome-Night-Vale-CD-N... 1.0 \n","299 https://www.amazon.com/StudioCanal-Collection-... 1.0 \n","300 https://www.amazon.com/Art-John-Alvin-Andrea/d... 1.0 \n","301 https://www.amazon.com/Apocalypto-Blu-ray-Rudy... 1.0 \n","302 https://www.amazon.com/Cinelinx-Card-Game-Peop... 1.0 \n","\n"," subreddit_mentions subreddit \n","0 4 r/gaming \n","1 3 r/gaming \n","2 3 r/gaming \n","3 2 r/gaming \n","4 2 r/gaming \n",".. ... ... \n","298 1 r/movies \n","299 1 r/movies \n","300 1 r/movies \n","301 1 r/movies \n","302 1 r/movies \n","\n","[796 rows x 6 columns]"]},"execution_count":8,"metadata":{},"output_type":"execute_result"}],"source":["combined_products = pd.concat([gaming_products,movie_products])\n","\n","# Check your answer\n","q3.check()\n","combined_products"]},{"cell_type":"code","execution_count":9,"id":"b6b0f31a","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:15.328005Z","iopub.status.busy":"2022-04-06T10:25:15.327033Z","iopub.status.idle":"2022-04-06T10:25:15.330529Z","shell.execute_reply":"2022-04-06T10:25:15.331075Z","shell.execute_reply.started":"2022-04-06T10:23:03.268437Z"},"papermill":{"duration":0.033977,"end_time":"2022-04-06T10:25:15.331256","exception":false,"start_time":"2022-04-06T10:25:15.297279","status":"completed"},"tags":[]},"outputs":[],"source":["#q3.hint()\n","#q3.solution()"]},{"cell_type":"markdown","id":"d8b09258","metadata":{"papermill":{"duration":0.026652,"end_time":"2022-04-06T10:25:15.384866","exception":false,"start_time":"2022-04-06T10:25:15.358214","status":"completed"},"tags":[]},"source":["## 4.\n","The [Powerlifting Database](https://www.kaggle.com/open-powerlifting/powerlifting-database) dataset on Kaggle includes one CSV table for powerlifting meets and a separate one for powerlifting competitors. Run the cell below to load these datasets into dataframes:"]},{"cell_type":"code","execution_count":10,"id":"418663ab","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:15.444062Z","iopub.status.busy":"2022-04-06T10:25:15.443083Z","iopub.status.idle":"2022-04-06T10:25:16.360603Z","shell.execute_reply":"2022-04-06T10:25:16.359984Z","shell.execute_reply.started":"2022-04-06T10:23:03.274058Z"},"papermill":{"duration":0.947537,"end_time":"2022-04-06T10:25:16.36075","exception":false,"start_time":"2022-04-06T10:25:15.413213","status":"completed"},"tags":[]},"outputs":[],"source":["powerlifting_meets = pd.read_csv(\"../input/powerlifting-database/meets.csv\")\n","powerlifting_competitors = pd.read_csv(\"../input/powerlifting-database/openpowerlifting.csv\")"]},{"cell_type":"markdown","id":"327cc71a","metadata":{"papermill":{"duration":0.027136,"end_time":"2022-04-06T10:25:16.415113","exception":false,"start_time":"2022-04-06T10:25:16.387977","status":"completed"},"tags":[]},"source":["Both tables include references to a `MeetID`, a unique key for each meet (competition) included in the database. Using this, generate a dataset combining the two tables into one."]},{"cell_type":"code","execution_count":11,"id":"09e91df4","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:16.475759Z","iopub.status.busy":"2022-04-06T10:25:16.474613Z","iopub.status.idle":"2022-04-06T10:25:17.885162Z","shell.execute_reply":"2022-04-06T10:25:17.885706Z","shell.execute_reply.started":"2022-04-06T10:23:04.057838Z"},"papermill":{"duration":1.443816,"end_time":"2022-04-06T10:25:17.885886","exception":false,"start_time":"2022-04-06T10:25:16.44207","status":"completed"},"tags":[]},"outputs":[{"data":{"application/javascript":["parent.postMessage({\"jupyterEvent\": \"custom.exercise_interaction\", \"data\": {\"outcomeType\": 1, \"valueTowardsCompletion\": 0.25, \"interactionType\": 1, \"questionType\": 2, \"questionId\": \"4_JoinLifting\", \"learnToolsVersion\": \"0.3.4\", \"failureMessage\": \"\", \"exceptionClass\": \"\", \"trace\": \"\"}}, \"*\")"],"text/plain":[""]},"metadata":{},"output_type":"display_data"},{"data":{"text/markdown":["Correct"],"text/plain":["Correct"]},"metadata":{},"output_type":"display_data"},{"data":{"text/html":["
\n","\n","\n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n"," \n","
MeetPathFederationDateMeetCountryMeetStateMeetTownMeetNameNameSexEquipment...WeightClassKgSquat4KgBestSquatKgBench4KgBestBenchKgDeadlift4KgBestDeadliftKgTotalKgPlaceWilks
MeetID
0365strong/1601365Strong2016-10-29USANCCharlotte2016 Junior & Senior National Powerlifting Cha...Angie Belk TerryFWraps...60NaN47.63NaN20.41NaN70.31138.351155.05
0365strong/1601365Strong2016-10-29USANCCharlotte2016 Junior & Senior National Powerlifting Cha...Dawn BogartFSingle-ply...60NaN142.88NaN95.25NaN163.29401.421456.38
0365strong/1601365Strong2016-10-29USANCCharlotte2016 Junior & Senior National Powerlifting Cha...Dawn BogartFSingle-ply...60NaN142.88NaN95.25NaN163.29401.421456.38
0365strong/1601365Strong2016-10-29USANCCharlotte2016 Junior & Senior National Powerlifting Cha...Dawn BogartFRaw...60NaNNaNNaN95.25NaNNaN95.251108.29
0365strong/1601365Strong2016-10-29USANCCharlotte2016 Junior & Senior National Powerlifting Cha...Destiny DulaFRaw...67.5NaNNaNNaN31.75NaN90.72122.471130.47
..................................................................
8481xpc/2017-finalsXPC2017-03-03USAOHColumbus2017 XPC FinalsWilliam BarabasMMulti-ply...125NaNNaNNaNNaNNaN347.50347.502202.60
8481xpc/2017-finalsXPC2017-03-03USAOHColumbus2017 XPC FinalsJustin ZottlMMulti-ply...125NaNNaNNaNNaNNaN322.50322.503185.77
8481xpc/2017-finalsXPC2017-03-03USAOHColumbus2017 XPC FinalsJake AndersonMMulti-ply...125NaNNaNNaNNaNNaN367.50367.501211.17
8481xpc/2017-finalsXPC2017-03-03USAOHColumbus2017 XPC FinalsJeff BumanglagMMulti-ply...140NaNNaNNaNNaNNaN320.00320.003181.85
8481xpc/2017-finalsXPC2017-03-03USAOHColumbus2017 XPC FinalsShane HammockMMulti-ply...140NaNNaNNaNNaNNaN362.50362.502205.18
\n","

386414 rows × 23 columns

\n","
"],"text/plain":[" MeetPath Federation Date MeetCountry MeetState \\\n","MeetID \n","0 365strong/1601 365Strong 2016-10-29 USA NC \n","0 365strong/1601 365Strong 2016-10-29 USA NC \n","0 365strong/1601 365Strong 2016-10-29 USA NC \n","0 365strong/1601 365Strong 2016-10-29 USA NC \n","0 365strong/1601 365Strong 2016-10-29 USA NC \n","... ... ... ... ... ... \n","8481 xpc/2017-finals XPC 2017-03-03 USA OH \n","8481 xpc/2017-finals XPC 2017-03-03 USA OH \n","8481 xpc/2017-finals XPC 2017-03-03 USA OH \n","8481 xpc/2017-finals XPC 2017-03-03 USA OH \n","8481 xpc/2017-finals XPC 2017-03-03 USA OH \n","\n"," MeetTown MeetName \\\n","MeetID \n","0 Charlotte 2016 Junior & Senior National Powerlifting Cha... \n","0 Charlotte 2016 Junior & Senior National Powerlifting Cha... \n","0 Charlotte 2016 Junior & Senior National Powerlifting Cha... \n","0 Charlotte 2016 Junior & Senior National Powerlifting Cha... \n","0 Charlotte 2016 Junior & Senior National Powerlifting Cha... \n","... ... ... \n","8481 Columbus 2017 XPC Finals \n","8481 Columbus 2017 XPC Finals \n","8481 Columbus 2017 XPC Finals \n","8481 Columbus 2017 XPC Finals \n","8481 Columbus 2017 XPC Finals \n","\n"," Name Sex Equipment ... WeightClassKg Squat4Kg \\\n","MeetID ... \n","0 Angie Belk Terry F Wraps ... 60 NaN \n","0 Dawn Bogart F Single-ply ... 60 NaN \n","0 Dawn Bogart F Single-ply ... 60 NaN \n","0 Dawn Bogart F Raw ... 60 NaN \n","0 Destiny Dula F Raw ... 67.5 NaN \n","... ... .. ... ... ... ... \n","8481 William Barabas M Multi-ply ... 125 NaN \n","8481 Justin Zottl M Multi-ply ... 125 NaN \n","8481 Jake Anderson M Multi-ply ... 125 NaN \n","8481 Jeff Bumanglag M Multi-ply ... 140 NaN \n","8481 Shane Hammock M Multi-ply ... 140 NaN \n","\n"," BestSquatKg Bench4Kg BestBenchKg Deadlift4Kg BestDeadliftKg \\\n","MeetID \n","0 47.63 NaN 20.41 NaN 70.31 \n","0 142.88 NaN 95.25 NaN 163.29 \n","0 142.88 NaN 95.25 NaN 163.29 \n","0 NaN NaN 95.25 NaN NaN \n","0 NaN NaN 31.75 NaN 90.72 \n","... ... ... ... ... ... \n","8481 NaN NaN NaN NaN 347.50 \n","8481 NaN NaN NaN NaN 322.50 \n","8481 NaN NaN NaN NaN 367.50 \n","8481 NaN NaN NaN NaN 320.00 \n","8481 NaN NaN NaN NaN 362.50 \n","\n"," TotalKg Place Wilks \n","MeetID \n","0 138.35 1 155.05 \n","0 401.42 1 456.38 \n","0 401.42 1 456.38 \n","0 95.25 1 108.29 \n","0 122.47 1 130.47 \n","... ... ... ... \n","8481 347.50 2 202.60 \n","8481 322.50 3 185.77 \n","8481 367.50 1 211.17 \n","8481 320.00 3 181.85 \n","8481 362.50 2 205.18 \n","\n","[386414 rows x 23 columns]"]},"execution_count":11,"metadata":{},"output_type":"execute_result"}],"source":["left = powerlifting_meets.set_index('MeetID')\n","right = powerlifting_competitors.set_index('MeetID')\n","powerlifting_combined = left.join(right)\n","\n","# Check your answer\n","q4.check()\n","powerlifting_combined"]},{"cell_type":"code","execution_count":12,"id":"15ef8b69","metadata":{"execution":{"iopub.execute_input":"2022-04-06T10:25:17.950282Z","iopub.status.busy":"2022-04-06T10:25:17.948976Z","iopub.status.idle":"2022-04-06T10:25:17.953567Z","shell.execute_reply":"2022-04-06T10:25:17.952861Z","shell.execute_reply.started":"2022-04-06T10:23:05.182395Z"},"papermill":{"duration":0.038324,"end_time":"2022-04-06T10:25:17.953715","exception":false,"start_time":"2022-04-06T10:25:17.915391","status":"completed"},"tags":[]},"outputs":[],"source":["#q4.hint()\n","#q4.solution()"]},{"cell_type":"markdown","id":"82f26f0c","metadata":{"papermill":{"duration":0.028939,"end_time":"2022-04-06T10:25:18.01331","exception":false,"start_time":"2022-04-06T10:25:17.984371","status":"completed"},"tags":[]},"source":["# Congratulations!\n","\n","You've finished the Pandas micro-course. Many data scientists feel efficiency with Pandas is the most useful and practical skill they have, because it allows you to progress quickly in any project you have.\n","\n","If you'd like to apply your new skills to examining geospatial data, you're encouraged to check out our **[Geospatial Analysis](https://www.kaggle.com/learn/geospatial-analysis)** micro-course.\n","\n","You can also take advantage of your Pandas skills by entering a **[Kaggle Competition](https://www.kaggle.com/competitions)** or by answering a question you find interesting using **[Kaggle Datasets](https://www.kaggle.com/datasets)**."]},{"cell_type":"markdown","id":"046f8702","metadata":{"papermill":{"duration":0.030575,"end_time":"2022-04-06T10:25:18.073299","exception":false,"start_time":"2022-04-06T10:25:18.042724","status":"completed"},"tags":[]},"source":["---\n","\n","\n","\n","\n","*Have questions or comments? Visit the [course discussion forum](https://www.kaggle.com/learn/pandas/discussion) to chat with other learners.*"]}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.7.12"},"papermill":{"default_parameters":{},"duration":19.058404,"end_time":"2022-04-06T10:25:18.915769","environment_variables":{},"exception":null,"input_path":"__notebook__.ipynb","output_path":"__notebook__.ipynb","parameters":{},"start_time":"2022-04-06T10:24:59.857365","version":"2.3.3"}},"nbformat":4,"nbformat_minor":5} \ No newline at end of file