diff --git a/finalize_dataset.ipynb b/finalize_dataset.ipynb new file mode 100644 index 0000000..c3a61a1 --- /dev/null +++ b/finalize_dataset.ipynb @@ -0,0 +1,679 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d23f4cf0", + "metadata": {}, + "source": [ + "# Assign O-Grades from 8a.eu data on Adam Ondra's Sport Climbing\n", + "Created By: Noah Rizika\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d56dc9ff", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "a340c91e", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "\n", + "datafile = '/Users/noahrizika/Documents/PersonalCodes/ogrades/ogrades.csv'\n", + "\n", + "# df = pd.read_csv(datafile)\n", + "df = pd.read_csv(datafile, encoding='unicode_escape')\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "a5017704", + "metadata": {}, + "outputs": [], + "source": [ + "def separate_string(initial_string, substrings):\n", + " for substring in substrings:\n", + " index = initial_string.find(substring)\n", + " if index != -1:\n", + " return initial_string[:index], initial_string[index:]\n", + " # If none of the substrings match, return the initial string as the first part and an empty string as the second part\n", + " return initial_string, \"\"\n", + "\n", + "countries = [\n", + " \"Czechia\", \"United States\", \"France\",\n", + " \"Afghanistan\", \"Albania\", \"Algeria\", \"Andorra\", \"Angola\", \"Antigua\", \"Barbuda\", \"Argentina\", \"Armenia\", \"Australia\", \"Austria\",\n", + " \"Azerbaijan\", \"Bahamas\", \"Bahrain\", \"Bangladesh\", \"Barbados\", \"Belarus\", \"Belgium\", \"Belize\", \"Benin\", \"Bhutan\", \"Bolivia\",\n", + " \"Bosnia\", \"Herzegovina\", \"Botswana\", \"Brazil\", \"Brunei\", \"Bulgaria\", \"Burkina Faso\", \"Burundi\", \"Cabo Verde\", \"Cambodia\",\n", + " \"Cameroon\", \"Canada\", \"Central African Republic\", \"Chad\", \"Chile\", \"China\", \"Colombia\", \"Comoros\", \"Congo (Congo-Brazzaville)\",\n", + " \"Costa Rica\", \"Croatia\", \"Cuba\", \"Cyprus\", \"Czechia (Czech Republic)\", \"Democratic Republic of the Congo\", \"Denmark\", \"Djibouti\",\n", + " \"Dominica\", \"Dominican Republic\", \"Ecuador\", \"Egypt\", \"El Salvador\", \"Equatorial Guinea\", \"Eritrea\", \"Estonia\", \"Eswatini\",\n", + " \"Ethiopia\", \"Fiji\", \"Finland\", \"Gabon\", \"Gambia\", \"Georgia\", \"Germany\", \"Ghana\", \"Greece\", \"Grenada\", \"Guatemala\",\n", + " \"Guinea\", \"Guinea-Bissau\", \"Guyana\", \"Haiti\", \"Holy See\", \"Honduras\", \"Hungary\", \"Iceland\", \"India\", \"Indonesia\", \"Iran\",\n", + " \"Iraq\", \"Ireland\", \"Israel\", \"Italy\", \"Jamaica\", \"Japan\", \"Jordan\", \"Kazakhstan\", \"Kenya\", \"Kiribati\", \"Kuwait\", \"Kyrgyzstan\",\n", + " \"Laos\", \"Latvia\", \"Lebanon\", \"Lesotho\", \"Liberia\", \"Libya\", \"Liechtenstein\", \"Lithuania\", \"Luxembourg\", \"Madagascar\", \"Malawi\",\n", + " \"Malaysia\", \"Maldives\", \"Mali\", \"Malta\", \"Marshall Islands\", \"Mauritania\", \"Mauritius\", \"Mexico\", \"Micronesia\", \"Moldova\",\n", + " \"Monaco\", \"Mongolia\", \"Montenegro\", \"Morocco\", \"Mozambique\", \"Myanmar (formerly Burma)\", \"Namibia\", \"Nauru\", \"Nepal\",\n", + " \"Netherlands\", \"New Zealand\", \"Nicaragua\", \"Niger\", \"Nigeria\", \"North Korea\", \"North Macedonia\", \"Norway\", \"Oman\", \"Pakistan\",\n", + " \"Palau\", \"Palestine State\", \"Panama\", \"Papua New Guinea\", \"Paraguay\", \"Peru\", \"Philippines\", \"Poland\", \"Portugal\", \"Qatar\",\n", + " \"Romania\", \"Russia\", \"Rwanda\", \"Saint Kitts\", \"Nevis\", \"Saint Lucia\", \"Saint Vincent and the Grenadines\", \"Samoa\", \"San Marino\",\n", + " \"Sao Tome\", \"Principe\", \"Saudi Arabia\", \"Senegal\", \"Serbia\", \"Seychelles\", \"Sierra Leone\", \"Singapore\", \"Slovakia\", \"Slovenia\",\n", + " \"Solomon Islands\", \"Somalia\", \"South Africa\", \"South Korea\", \"South Sudan\", \"Spain\", \"Sri Lanka\", \"Sudan\", \"Suriname\", \"Sweden\",\n", + " \"Switzerland\", \"Syria\", \"Tajikistan\", \"Tanzania\", \"Thailand\", \"Timor-Leste\", \"Togo\", \"Tonga\", \"Trinidad\", \"Tobago\", \"Tunisia\",\n", + " \"Turkey\", \"Turkmenistan\", \"Tuvalu\", \"Uganda\", \"Ukraine\", \"United Arab Emirates\", \"United Kingdom\", \"United States of America\",\n", + " \"Uruguay\", \"Uzbekistan\", \"Vanuatu\", \"Venezuela\", \"Vietnam\", \"Yemen\", \"Zambia\", \"Zimbabwe\", \"Unknown\"\n", + "]\n", + "\n", + "index = 0\n", + "for value in df['name-and-loc']:\n", + " climb_name, location = separate_string(value, countries)\n", + " df.at[index, 'name'] = climb_name\n", + " df.at[index, 'location'] = location\n", + " index += 1\n", + "# print(climb_name + ' // ' + location)" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "d1df9ee9", + "metadata": { + "scrolled": true + }, + "outputs": [], + "source": [ + "# clean text\n", + "from unidecode import unidecode\n", + "import unicodedata\n", + "\n", + "def remove_accents(input_str):\n", + "# nfkd_form = unicodedata.normalize('NFKD', input_str)\n", + "# return u\"\".join([c for c in nfkd_form if not unicodedata.combining(c)])\n", + " return unidecode(input_str)\n", + "\n", + "index = 0\n", + "for name in df['name']:\n", + " clean_name = remove_accents(name)\n", + " df.at[index, 'name'] = clean_name.lower()\n", + " df.at[index, 'location'] = remove_accents(df.at[index, 'location'])\n", + " index += 1\n", + "\n", + "for i in range(88):\n", + " if type(df.at[i, 'name-flash']) != float and type(df.at[i, 'location-flash']) != float:\n", + " clean_name = remove_accents(df.at[i, 'name-flash'])\n", + " df.at[i, 'name-flash'] = clean_name.lower()\n", + " df.at[i, 'location-flash'] = remove_accents(df.at[i, 'location-flash'])" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "a6d34a01", + "metadata": {}, + "outputs": [], + "source": [ + "# identify average duration a climb took him to complete\n", + "\n", + "# at every point in comment:\n", + "# if there is a number:\n", + "# concatenate that number with a window size of [0,5] into the temp-comment column for the given climb\n", + "\n", + "def appendCommentNumber(number):\n", + " number = str(number)\n", + " if comment.find(number) >= 0:\n", + " subindex = comment.find(number)\n", + " try:\n", + " append_comment = comment[subindex : subindex + 8]\n", + " \n", + " # append the number with day, month, or year for context\n", + " if append_comment.find('day') >= 0 or append_comment.find('week') >= 0 or append_comment.find('month') >= 0 or append_comment.find('year') >= 0:\n", + " df.at[index, 'temp-comment'] = str(df.at[index, 'temp-comment']) + ', ' + append_comment\n", + " \n", + " # otherwise just append number without context\n", + " else:\n", + " df.at[index, 'temp-comment'] = str(df.at[index, 'temp-comment']) + ', ' + comment[subindex]\n", + " except:\n", + " df.at[index, 'temp-comment'] = str(df.at[index, 'temp-comment']) + ', ' + comment[subindex]\n", + "\n", + "index = 0\n", + "for comment in df['comment']:\n", + " if type(comment) == float:\n", + " index += 1\n", + " continue\n", + " df.at[index, 'temp-comment'] = ''\n", + " appendCommentNumber(1)\n", + " appendCommentNumber(2)\n", + " appendCommentNumber(3)\n", + " appendCommentNumber(4)\n", + " appendCommentNumber(5)\n", + " appendCommentNumber(6)\n", + " appendCommentNumber(7)\n", + " appendCommentNumber(8)\n", + " appendCommentNumber(9)\n", + " index += 1 \n" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "737bfe76", + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "snumber_to_int = {\n", + " 'one': '1',\n", + " 'two': '2',\n", + " 'three': '3',\n", + " 'four': '4',\n", + " 'five': '5',\n", + " 'six': '6',\n", + " 'seven': '7',\n", + " 'eight': '8',\n", + " 'nine': '9',\n", + " 'ten': '10',\n", + " 'eleven': '11',\n", + " 'twelve': '12',\n", + " 'thirteen': '13',\n", + " 'fourteen': '14',\n", + " 'fifteen': '15',\n", + " 'sixteen': '16',\n", + " 'seventeen': '17',\n", + " 'eighteen': '18',\n", + " 'nineteen': '19',\n", + " 'twenty': '20',\n", + " 'first': '1',\n", + " 'second': '2',\n", + " 'third': '3',\n", + " 'fourth': '4',\n", + " 'fifth': '5',\n", + " 'sixth': '6',\n", + " 'seventh': '7',\n", + " 'eighth': '8',\n", + " 'ninth': '9',\n", + " 'tenth': '10',\n", + " 'eleventh': '11',\n", + " 'twelfth': '12',\n", + " 'thirteenth': '13',\n", + " 'fourteenth': '14',\n", + " 'fifteenth': '15',\n", + " 'sixteenth': '16',\n", + " 'seventeenth': '17',\n", + " 'eighteenth': '18',\n", + " 'nineteenth': '19',\n", + " 'twentieth': '20',\n", + " '1st': '1',\n", + " '2nd': '2',\n", + " '3rd': '3',\n", + " '4th': '4',\n", + " '5th': '5',\n", + " '6th': '6',\n", + " '7th': '7',\n", + " '8th': '8',\n", + " '9th': '9',\n", + " '10th': '10',\n", + " '11th': '11',\n", + " '12th': '12',\n", + " '13th': '13',\n", + " '14th': '14',\n", + " '15th': '15',\n", + " '16th': '16',\n", + " '17th': '17',\n", + " '18th': '18',\n", + " '19th': '19',\n", + " '20th': '20'\n", + "}\n", + "\n", + "# given a comment, convert a word (based on the index of the final letter in the word) into its number (ie: two -> 2)\n", + "\n", + "def getIntFromString(comment, time_ratio, substring, index):\n", + " subindex = comment.find(substring)\n", + " for i in range(10):\n", + "# while subindex < len(comment):\n", + " number_end_index = subindex - 2\n", + "\n", + " # iterate backwards to get the starting index of the word preceeding week\n", + " number_start_index = number_end_index\n", + " while number_start_index >= 0 and (comment[number_start_index] != ' '):\n", + " number_start_index -= 1\n", + "\n", + " if number_start_index > 0: \n", + " number_start_index += 1 # index is at the space before the number\n", + " number_end_index += 1 # index is at the number's second to last character\n", + " snumber = comment[number_start_index : number_end_index]\n", + " \n", + " if snumber.find('-') >= 0:\n", + " snumber = snumber.split('-')[0]\n", + " \n", + " if snumber in snumber_to_int:\n", + " ograde = str(int(snumber_to_int[snumber]) * time_ratio)\n", + " df.at[index, 'o-grade'] = ograde\n", + " print(str(index) + '. if: ' + ograde + '. ' + df.at[index, 'name'])\n", + " break\n", + "\n", + " try:\n", + " snumber_temp = int(snumber)\n", + " ograde = str(snumber_temp * time_ratio)\n", + " df.at[index, 'o-grade'] = ograde\n", + " print(str(index) + '. try: ' + ograde + '. ' + df.at[index, 'name'])\n", + " break\n", + "\n", + " except ValueError:\n", + "# print('ERROR: ' + str(snumber) + '. ' + df.at[index, 'name'])\n", + " df.at[index, 'name']\n", + " comment = comment[subindex + 1 : ]\n", + " subindex = comment.find(substring)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "0eaf8fee", + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2. try: 20. vasil vasil\n", + "5. if: 2. el maquinista\n", + "6. if: 2. b je to!\n", + "9. if: 1. the lonely mountain\n", + "13. try: 8. disbelief\n", + "14. try: 9. eagle-4\n", + "17. try: 4. queen line\n", + "19. try: 1. robin ad\n", + "20. if: 2. stoking the fire\n", + "21. try: 3. c.r.s.\n", + "23. try: 14. move\n", + "24. try: 6. iron curtain\n", + "26. try: 7. la planta de shiva\n", + "27. try: 8. chaxiraxi\n", + "28. if: 1. golpe de estado\n", + "30. if: 1. fantazija\n", + "32. try: 4. bombardino\n", + "33. if: 1. trofeo dell'adriatico\n", + "34. try: 9. furia de jabali\n", + "38. try: 10. qui\n", + "41. try: 2. high line\n", + "49. if: 21. naturalmente\n", + "50. if: 2. lapsus\n", + "52. try: 4. pachamama\n", + "59. if: 3. biographie\n", + "60. try: 2. ia+-i ameriketan\n", + "61. try: 4. hell racer\n", + "63. if: 2. torture physique integrale\n", + "68. try: 3. overshadow\n", + "69. try: 3. chilam balam\n", + "71. try: 2. obrint el sistema\n", + "72. try: 7. la capella\n", + "73. try: 2. l'a(c)trange ivresse des lenteurs\n", + "74. try: 4. marina superstar\n", + "76. try: 5. papichulo\n", + "77. try: 5. open air\n", + "89. if: 1. pungitopo\n", + "112. if: 2. interklemezzo\n", + "132. try: 1. geocache\n", + "146. if: 1. la propha(c)tie des grenouilles\n", + "165. if: 3. climb for life\n", + "186. try: 4. a present for the future\n", + "191. try: 2. im reich des shogun\n", + "196. try: 2. om\n", + "197. try: 3. los revolucionarios\n", + "200. try: 3. punt'x\n", + "201. try: 2. campo con corvi\n", + "229. if: 1. la bongada\n", + "230. if: 1. directa rodillar\n", + "279. if: 13. deportace ze zeme\n", + "281. if: 2. sever the wicked hand\n", + "288. if: 14. tres satelites\n", + "350. try: 4. zugzwang\n", + "478. if: 2. fifty words for pump\n", + "485. if: 1. show me reality\n", + "496. if: 1. mora mora\n", + "497. if: 1. tough enough original\n", + "543. try: 3. woga 1/4 \n", + "726. if: 1. tough enough\n", + "783. if: 1. silbergeier\n", + "1348. try: 1. ali baba\n", + "1531. if: 1. meat grinder arete\n" + ] + } + ], + "source": [ + "# from temp-comment to attempt-count, set o-grade\n", + "\n", + "# if has X day, X week, X month or X year in it, move just that to attempt-count\n", + "\n", + "index = 0\n", + "for comment in df['comment']:\n", + " if type(comment) == float:\n", + " index += 1\n", + " continue \n", + " elif comment.find('week') >= 0:\n", + " getIntFromString(comment, 7, 'week', index)\n", + " elif comment.find('day') >= 0:\n", + " getIntFromString(comment, 1, 'day', index) \n", + " index += 1" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "bbddf7a0", + "metadata": {}, + "outputs": [], + "source": [ + "# set all near flashes as O0\n", + "\n", + "index = 0\n", + "for attempt in df['fa']:\n", + " if attempt == '2-nd try' or attempt == '2nd go' or attempt == '2nd Go':\n", + " df.at[index, 'o-grade'] = '0'\n", + " index += 1\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "549c065a", + "metadata": {}, + "outputs": [], + "source": [ + "# set flashes to O0\n", + "\n", + "# is the name and location found in name-flash and location-flash? if yes, set o-grade to O0\n", + "index = 0\n", + "for name in df['name']:\n", + " for i in range(88):\n", + " if name == df.at[i, 'name-flash'] and df.at[index, 'location'] == df.at[i, 'location-flash']:\n", + " df.at[index, 'o-grade'] = '0'\n", + " index += 1 \n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "id": "3f3415f3", + "metadata": {}, + "outputs": [], + "source": [ + "# specific fixes\n", + "\n", + "df.at[1, 'o-grade'] = \"10\" # zvaainec\n", + "df.at[4, 'o-grade'] = \"20\" # change\n", + "df.at[61, 'o-grade'] = \"4\" # hell racer\n", + "df.at[3, 'o-grade'] = \"37\" # la dura dura\n", + "df.at[0, 'o-grade'] = \"40\" # silence\n", + "df.at[23, 'o-grade'] = \"14\" # move\n", + "df.at[2, 'o-grade'] = \"23\" # vasil vasil\n", + "df.at[49, 'o-grade'] = \"3\" # naturalmente\n", + "df.at[188, 'name'] = \"life's blood for the downtrodden\"\n", + "df.at[1491, 'name'] = \"realitats verlust\"\n", + "df.at[1519, 'location'] = \"sweden, bohuslan, granitgrottan\"" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "1ef9edc8", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "['3', '2']\n" + ] + } + ], + "source": [ + "nonflash_grades = ['9b', '9a+']\n", + "store_averages = []\n", + "\n", + "# get the average grade of each o-graded climb for the given font grade\n", + "for actual_grade in nonflash_grades:\n", + " sum_grades = 0\n", + " count_grades = 0\n", + " for index, ograde in enumerate(df['o-grade']):\n", + " if df.at[index, 'actual-grade'] == actual_grade:\n", + " count_grades += 1\n", + " try:\n", + " ograde = int(ograde)\n", + " sum_grades += ograde\n", + " except:\n", + " continue\n", + " grade_average = sum_grades/count_grades\n", + " store_averages.append(str(round(grade_average)))\n", + "\n", + "# set the average o-grade for climbs of the same font grade\n", + "for grade_index, actual_grade in enumerate(nonflash_grades):\n", + " for index, ograde in enumerate(df['o-grade']):\n", + " if df.at[index, 'actual-grade'] == actual_grade and pd.isnull(ograde):\n", + " df.at[index, 'o-grade'] = store_averages[grade_index]\n", + "\n", + "print(store_averages)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 64, + "id": "eccba0ee", + "metadata": {}, + "outputs": [], + "source": [ + "other_grades = {'9a' : '1','8c+' : '0 +','8c' : '0', '8b+' : '0', '8b' : '0 -', '8a+' : '0 -', '8a' : '-1 +', '7c+' : '-1', '7c' : '-1 -', '7b+' : '-2 +', '7b' : '-2', '7a+' : '-2 -', '7a' : '-2 -'}\n", + "actual_grades = list(other_grades.keys())\n", + "for actual_grade in actual_grades:\n", + " for index, ograde in enumerate(df['o-grade']):\n", + " if df.at[index, 'actual-grade'] == actual_grade and pd.isnull(ograde):\n", + " df.at[index, 'o-grade'] = other_grades[actual_grade]" + ] + }, + { + "cell_type": "code", + "execution_count": 65, + "id": "22f1d058", + "metadata": {}, + "outputs": [], + "source": [ + "for index, ograde in enumerate(df['o-grade']):\n", + " if pd.isnull(ograde):\n", + " print(ograde)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5844ae49", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 68, + "id": "9a23fdd1", + "metadata": {}, + "outputs": [], + "source": [ + "# set abbreviated comments\n", + "\n", + "for index, comment in enumerate(df['comment']):\n", + " df.at[index, 'abv-comment'] = 'x'\n", + " if type(comment) == str:\n", + " comment = comment.lower()\n", + " if comment.find('not hard') >= 0:\n", + " df.at[index, 'abv-comment'] = 'not hard'\n", + " \n", + " elif comment.find('hard') >= 0:\n", + " df.at[index, 'abv-comment'] = 'hard'\n", + "\n", + " elif comment.find('not soft') >= 0:\n", + " df.at[index, 'abv-comment'] = 'not soft'\n", + "\n", + " elif comment.find('soft') >= 0:\n", + " df.at[index, 'abv-comment'] = 'soft'\n", + "\n", + " elif comment.find('not easy') >= 0:\n", + " df.at[index, 'abv-comment'] = 'not easy'\n", + " \n", + " elif comment.find('easy') >= 0:\n", + " df.at[index, 'abv-comment'] = 'easy'\n", + "\n", + " elif comment.find('amazing') >= 0:\n", + " df.at[index, 'abv-comment'] = 'amazing'\n", + "\n", + " elif comment.find('awkward') >= 0:\n", + " df.at[index, 'abv-comment'] = 'awkward'\n", + "\n", + " elif comment.find('perfect') >= 0:\n", + " df.at[index, 'abv-comment'] = 'perfect'\n", + "\n", + " elif comment.find('fun') >= 0:\n", + " df.at[index, 'abv-comment'] = 'fun'\n", + "\n", + " elif comment.find('strange') >= 0:\n", + " df.at[index, 'abv-comment'] = 'strange'\n", + "\n", + " elif comment.find('awesome') >= 0:\n", + " df.at[index, 'abv-comment'] = 'awesome'\n", + "\n", + " elif comment.find('technical') >= 0:\n", + " df.at[index, 'abv-comment'] = 'technical'\n", + " \n", + " elif comment.find('bouldery') >= 0:\n", + " df.at[index, 'abv-comment'] = 'bouldery'\n", + "\n", + " elif comment.find('tricky') >= 0:\n", + " df.at[index, 'abv-comment'] = 'tricky'\n", + "\n", + " elif comment.find('classic') >= 0:\n", + " df.at[index, 'abv-comment'] = 'classic'\n", + " \n", + " elif comment.find('not good') >= 0:\n", + " df.at[index, 'abv-comment'] = 'not good'\n", + "\n", + " elif comment.find('not nice') >= 0:\n", + " df.at[index, 'abv-comment'] = 'not nice'\n", + " \n", + " elif comment.find('nice') >= 0:\n", + " df.at[index, 'abv-comment'] = 'nice'" + ] + }, + { + "cell_type": "code", + "execution_count": 69, + "id": "e1d2f342", + "metadata": {}, + "outputs": [], + "source": [ + "# specific fixes\n", + "\n", + "df.at[0, 'abv-comment'] = '' # silence\n", + "df.at[1, 'abv-comment'] = 'quite a bit harder than other 9b+ I have done or tried' # zvaainec" + ] + }, + { + "cell_type": "code", + "execution_count": 70, + "id": "b6c6b194", + "metadata": {}, + "outputs": [], + "source": [ + "# save as WIP csv\n", + "\n", + "savedata = '/Users/noahrizika/Documents/PersonalCodes/ogrades/ogrades_wip.csv'\n", + "df.to_csv(path_or_buf = savedata)" + ] + }, + { + "cell_type": "code", + "execution_count": 71, + "id": "7b5be412", + "metadata": {}, + "outputs": [], + "source": [ + "# finalize csv\n", + "df = df.drop(columns='name-and-loc')\n", + "df = df.drop(columns='date')\n", + "df = df.drop(columns='temp-comment')\n", + "df = df.drop(columns='attempt-count')\n", + "df = df.drop(columns='name-flash')\n", + "df = df.drop(columns='location-flash')\n", + "df = df.drop(columns='fa')\n", + "df = df.drop(columns='actual-grade')\n", + "df = df.drop(columns='comment')" + ] + }, + { + "cell_type": "code", + "execution_count": 72, + "id": "0fc949ef", + "metadata": {}, + "outputs": [], + "source": [ + "# save as finalized csv\n", + "\n", + "savedata = '/Users/noahrizika/Documents/PersonalCodes/ogrades/ogrades_final.csv'\n", + "df.to_csv(path_or_buf = savedata)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "36f17886", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "10402a9f", + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "baff1deb", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "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.11.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}