diff --git a/your-code/challenge-1.ipynb b/your-code/challenge-1.ipynb index 48f6b46..567d21c 100755 --- a/your-code/challenge-1.ipynb +++ b/your-code/challenge-1.ipynb @@ -15,11 +15,11 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 38, "metadata": {}, "outputs": [], "source": [ - "# Your code here" + "tup=(\"I\",)" ] }, { @@ -33,11 +33,22 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 39, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "tuple" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here" + "type(tup)" ] }, { @@ -55,13 +66,27 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 40, "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "AttributeError", + "evalue": "'tuple' object has no attribute 'append'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mtup\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"r\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"o\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"n\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"h\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"a\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"c\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"k\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m# Your explanation here\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;31m# Tuples are unchangeable, so I can not add or remove or reorder elements\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mAttributeError\u001b[0m: 'tuple' object has no attribute 'append'" + ] + } + ], "source": [ - "# Your code here\n", + "tup.append(\"r\", \"o\", \"n\", \"h\", \"a\", \"c\", \"k\")\n", + "\n", + "# Your explanation here\n", "\n", - "# Your explanation here\n" + "# Tuples are unchangeable, so I can not add or remove or reorder elements\n" ] }, { @@ -79,13 +104,14 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 45, "metadata": {}, "outputs": [], "source": [ - "# Your code here\n", "\n", - "# Your explanation here\n" + "tup=(\"I\", \"r\", \"o\", \"n\", \"h\", \"a\", \"c\", \"k\")\n", + "# Your explanation here\n", + "# I am overwriting the tup element, so when I call \"tup\" in the future I will be working with the last tuple created\n" ] }, { @@ -103,11 +129,25 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 66, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('I', 'r', 'o', 'n')\n", + "('h', 'a', 'c', 'k')\n" + ] + } + ], "source": [ - "# Your code here\n" + "\n", + "tup1= tup[:4]\n", + "tup2 = tup[-4:]\n", + "\n", + "print (tup1)\n", + "print (tup2)" ] }, { @@ -121,11 +161,33 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 64, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "('I', 'r', 'o', 'n', 'h', 'a', 'c', 'k')\n" + ] + }, + { + "data": { + "text/plain": [ + "8" + ] + }, + "execution_count": 64, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here\n" + "\n", + "tup3=(tup1+tup2)\n", + "print(tup3)\n", + "type(tup3)\n", + "len(tup3)" ] }, { @@ -137,11 +199,26 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 67, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "4\n", + "4\n", + "8\n", + "8\n" + ] + } + ], "source": [ - "# Your code here\n" + "\n", + "print(len(tup1))\n", + "print(len(tup2))\n", + "print(len(tup1)+len(tup2))\n", + "print(len(tup3))" ] }, { @@ -153,11 +230,22 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 69, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "4" + ] + }, + "execution_count": 69, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here" + "tup3.index(\"h\")" ] }, { @@ -177,11 +265,24 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 71, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "a True\n", + "c True\n" + ] + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "letters = [\"a\", \"b\", \"c\", \"d\", \"e\"]\n", + "for l in letters:\n", + " if l in tup3:\n", + " print(l, \"True\")" ] }, { @@ -195,11 +296,22 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 80, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2\n" + ] + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "for l in letters:\n", + " r+=tup3.count(l)\n", + "print(r)" ] }, { @@ -211,12 +323,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 85, "metadata": {}, "outputs": [], "source": [ - "# Your code here\n" + "# Your code here\n", + "\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -235,7 +355,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.8.3" } }, "nbformat": 4, diff --git a/your-code/challenge-2.ipynb b/your-code/challenge-2.ipynb index ef7bde3..c855370 100755 --- a/your-code/challenge-2.ipynb +++ b/your-code/challenge-2.ipynb @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -38,11 +38,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ - "# Your code here\n" + "# Your code here\n", + "\n", + "sample_list_1=random.sample(range(100), 80)\n", + " " ] }, { @@ -54,11 +57,14 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ - "# Your code here\n" + "\n", + "set1=set(sample_list_1)\n", + "\n", + "\n" ] }, { @@ -77,11 +83,25 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Your code here\n" + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[97, 12, 35, 81, 33, 51, 56, 47, 22, 31, 99, 4, 64, 50, 60, 74, 58, 81, 48, 47, 99, 17, 26, 96, 79, 5, 50, 41, 6, 23, 13, 97, 82, 81, 30, 37, 65, 0, 21, 95, 97, 23, 11, 77, 58, 51, 45, 69, 41, 97, 28, 87, 63, 50, 19, 68, 5, 31, 57, 77, 42, 87, 46, 52, 54, 35, 50, 79, 14, 88, 49, 91, 71, 18, 23, 93, 86, 85, 87, 0, 17]\n" + ] + } + ], + "source": [ + "# Your code here\n", + "sample_list_2=[]\n", + "\n", + "for i in range (0,81):\n", + " sample_list_2.append(random.randrange(0, 101))\n", + "\n", + "print(sample_list_2)" ] }, { @@ -93,11 +113,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Your code here\n" + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "57\n" + ] + } + ], + "source": [ + "# Your code here\n", + "\n", + "set2=set(sample_list_2 )\n", + "print(len(set2))\n" ] }, { @@ -116,6 +147,24 @@ "# Your code here\n" ] }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{1, 3, 7, 8, 9, 15, 16, 20, 25, 32, 34, 36, 38, 43, 44, 53, 55, 59, 61, 62, 66, 67, 70, 73, 75, 76, 80, 83, 84, 89, 92, 94, 98}\n" + ] + } + ], + "source": [ + "set3 = set1-set2\n", + "print(set3)\n" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -125,11 +174,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{64, 33, 97, 37, 45, 14, 79, 19, 28, 93}\n" + ] + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "set4 = set2-set1\n", + "print(set4)" ] }, { @@ -141,11 +200,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{0, 4, 5, 6, 11, 12, 13, 17, 18, 21, 22, 23, 26, 30, 31, 35, 41, 42, 46, 47, 48, 49, 50, 51, 52, 54, 56, 57, 58, 60, 63, 65, 68, 69, 71, 74, 77, 81, 82, 85, 86, 87, 88, 91, 95, 96, 99}\n" + ] + } + ], "source": [ - "# Your code here\n" + "# Your code here\n", + "set5=set1.intersection(set2)\n", + "print(set5)" ] }, { @@ -165,11 +234,28 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Your code here\n" + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "80\n", + "57\n", + "33\n", + "10\n", + "47\n" + ] + } + ], + "source": [ + "# Your code here\n", + "print(len(set1))\n", + "print(len(set2))\n", + "print(len(set3))\n", + "print(len(set4))\n", + "print(len(set5))\n" ] }, { @@ -181,11 +267,11 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ - "# Your code here\n" + "set6=set()" ] }, { @@ -197,11 +283,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 37, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "80\n" + ] + } + ], "source": [ - "# Your code here\n" + "set6.update(set3, set5)\n", + "print(len(set6))" ] }, { @@ -213,11 +308,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here\n" + "set1 == set6 \n" ] }, { @@ -229,11 +335,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "False\n", + "True\n" + ] + } + ], "source": [ - "# Your code here\n" + "print(set2.issubset(set1))\n", + "print(set3.issubset(set1))" ] }, { @@ -247,11 +363,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 31, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here\n" + "set3.union(set4, set5)==set1.union(set2)" ] }, { @@ -263,11 +390,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 36, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "0" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "# Your code here\n" + "set1.pop()" ] }, { @@ -283,11 +421,22 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], + "execution_count": 45, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{3, 4, 5, 6, 7, 8, 12, 13, 15, 16, 17, 18, 20, 22, 23, 25, 26, 30, 32, 34, 35, 36, 38, 42, 43, 44, 46, 47, 48, 50, 52, 53, 54, 55, 56, 57, 58, 60, 62, 63, 65, 66, 67, 68, 70, 73, 74, 75, 76, 77, 80, 82, 83, 84, 85, 86, 87, 88, 92, 94, 95, 96, 98}\n" + ] + } + ], "source": [ - "# Your code here\n" + "list_to_remove = [1, 9, 11, 19, 21, 29, 31, 39, 41, 49, 51, 59, 61, 69, 71, 79, 81, 89, 91, 99]\n", + "set_to_remove=set(list_to_remove)\n", + "remaining_set=set1-set_to_remove\n", + "print(remaining_set)" ] } ], @@ -307,7 +456,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.8.3" } }, "nbformat": 4, diff --git a/your-code/challenge-3.ipynb b/your-code/challenge-3.ipynb index 74d65e0..ab650c0 100755 --- a/your-code/challenge-3.ipynb +++ b/your-code/challenge-3.ipynb @@ -21,11 +21,13 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ - "# Your code here\n" + "dict1={\"Penelope\":178,\n", + " \"Arnau\":172,\n", + " \"Marta\":175}" ] }, { @@ -37,11 +39,23 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 8, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dict_keys(['Penelope', 'Arnau', 'Marta'])\n", + "dict_values([178, 172, 175])\n", + "dict_items([('Penelope', 178), ('Arnau', 172), ('Marta', 175)])\n" + ] + } + ], "source": [ - "# Your code here\n" + "print(dict1.keys())\n", + "print(dict1.values())\n", + "print(dict1.items())" ] }, { @@ -53,11 +67,20 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 10, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'Penelope': 178, 'Arnau': 172, 'Marta': 175, 'Sara': 162}\n" + ] + } + ], "source": [ - "# Your code here\n" + "dict1[\"Sara\"] = 162\n", + "print(dict1)" ] }, { @@ -69,11 +92,21 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 11, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'Penelope': 178, 'Arnau': 172, 'Marta': 175}\n" + ] + } + ], "source": [ - "# Your code here\n" + "\n", + "del dict1[\"Sara\"]\n", + "print(dict1)" ] }, { @@ -87,7 +120,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -121,11 +154,27 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 42, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'a': 8, 'about': 1, 'all': 1, 'although': 3, 'and': 23, 'are': 1, 'at': 1, 'baby': 14, 'backseat': 1, 'bag': 1, 'bar': 1, 'be': 16, 'bedsheets': 3, 'begin': 1, 'best': 1, 'body': 17, 'boy': 2, 'brand': 6, 'can': 1, 'chance': 1, 'club': 1, 'come': 37, 'conversation': 1, 'crazy': 2, 'dance': 1, 'date': 1, 'day': 6, 'discovering': 6, 'do': 3, 'doing': 2, \"don't\": 2, 'drinking': 1, 'driver': 1, 'eat': 1, 'every': 6, 'falling': 3, 'family': 1, 'fast': 1, 'fill': 2, 'find': 1, 'first': 1, 'follow': 6, 'for': 3, 'friends': 1, 'get': 1, 'girl': 2, 'give': 1, 'go': 2, 'going': 1, 'grab': 2, 'hand': 1, 'handmade': 2, 'heart': 3, 'hours': 2, 'how': 1, 'i': 6, \"i'll\": 1, \"i'm\": 23, 'in': 27, 'is': 5, \"isn't\": 1, 'it': 1, 'jukebox': 1, 'just': 1, 'kiss': 1, 'know': 2, 'last': 3, 'lead': 6, 'leave': 1, 'let': 1, \"let's\": 2, 'like': 10, 'love': 25, 'lover': 1, 'magnet': 3, 'make': 1, 'man': 1, 'may': 2, 'me': 10, 'mind': 2, 'much': 2, 'my': 33, 'new': 6, 'night': 3, 'not': 2, 'now': 11, 'of': 6, 'okay': 1, 'on': 40, 'one': 1, 'our': 1, 'out': 1, 'over': 1, 'place': 1, 'plate': 1, 'play': 1, 'pull': 3, 'push': 3, 'put': 3, 'radio': 1, 'room': 3, 'say': 2, 'shape': 6, 'shots': 1, 'singing': 2, 'slow': 1, 'smell': 3, 'so': 2, 'somebody': 2, 'something': 6, 'sour': 1, 'start': 2, 'stop': 1, 'story': 1, 'sweet': 1, 'table': 1, 'take': 1, 'talk': 4, 'taxi': 1, 'tell': 1, 'that': 2, 'the': 18, 'then': 3, 'thrifty': 1, 'to': 2, 'too': 5, 'trust': 1, 'up': 3, 'van': 1, 'waist': 2, 'want': 2, 'was': 2, 'we': 7, \"we're\": 1, 'week': 1, 'were': 3, 'where': 1, 'with': 22, 'you': 16, 'your': 21}\n" + ] + } + ], "source": [ - "# Your code here\n" + "word_freq2={}\n", + "\n", + "keys=list(word_freq.keys())\n", + "keys.sort()\n", + "for k in keys:\n", + " x=word_freq[k]\n", + " word_freq2[k]=x\n", + "print(word_freq2)\n", + "\n" ] }, { @@ -162,12 +211,48 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 43, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[('conversation', 1), (\"we're\", 1), ('plate', 1), ('sour', 1), ('jukebox', 1), ('taxi', 1), ('fast', 1), ('bag', 1), ('man', 1), ('going', 1), ('one', 1), ('backseat', 1), ('friends', 1), ('take', 1), ('play', 1), ('okay', 1), ('begin', 1), ('over', 1), ('just', 1), ('are', 1), ('tell', 1), ('drinking', 1), ('our', 1), ('where', 1), (\"i'll\", 1), ('all', 1), (\"isn't\", 1), ('make', 1), ('lover', 1), ('get', 1), ('radio', 1), ('give', 1), ('can', 1), ('club', 1), ('it', 1), ('out', 1), ('chance', 1), ('first', 1), ('table', 1), ('thrifty', 1), ('driver', 1), ('slow', 1), ('dance', 1), ('trust', 1), ('family', 1), ('week', 1), ('date', 1), ('leave', 1), ('at', 1), ('hand', 1), ('how', 1), ('eat', 1), ('about', 1), ('story', 1), ('sweet', 1), ('best', 1), ('let', 1), ('van', 1), ('shots', 1), ('place', 1), ('find', 1), ('kiss', 1), ('stop', 1), ('bar', 1), (\"don't\", 2), ('mind', 2), ('know', 2), ('so', 2), ('start', 2), ('boy', 2), ('girl', 2), ('singing', 2), ('doing', 2), ('somebody', 2), ('handmade', 2), ('may', 2), ('that', 2), ('much', 2), ('grab', 2), ('was', 2), ('say', 2), ('waist', 2), ('want', 2), (\"let's\", 2), ('not', 2), ('crazy', 2), ('go', 2), ('to', 2), ('fill', 2), ('hours', 2), ('push', 3), ('then', 3), ('put', 3), ('room', 3), ('magnet', 3), ('up', 3), ('pull', 3), ('last', 3), ('do', 3), ('smell', 3), ('although', 3), ('falling', 3), ('were', 3), ('night', 3), ('heart', 3), ('for', 3), ('bedsheets', 3), ('talk', 4), ('too', 5), ('is', 5), ('every', 6), ('new', 6), ('follow', 6), ('brand', 6), ('of', 6), ('i', 6), ('day', 6), ('lead', 6), ('shape', 6), ('discovering', 6), ('something', 6), ('we', 7), ('a', 8), ('like', 10), ('me', 10), ('now', 11), ('baby', 14), ('you', 16), ('be', 16), ('body', 17), ('the', 18), ('your', 21), ('with', 22), (\"i'm\", 23), ('and', 23), ('love', 25), ('in', 27), ('my', 33), ('come', 37), ('on', 40)]\n" + ] + } + ], "source": [ - "# Your code here\n" + "import operator\n", + "sorted_tups = sorted(word_freq.items(), key=operator.itemgetter(1))\n", + "print(sorted_tups)" ] + }, + { + "cell_type": "code", + "execution_count": 53, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{'conversation': 1, \"we're\": 1, 'plate': 1, 'sour': 1, 'jukebox': 1, 'taxi': 1, 'fast': 1, 'bag': 1, 'man': 1, 'going': 1, 'one': 1, 'backseat': 1, 'friends': 1, 'take': 1, 'play': 1, 'okay': 1, 'begin': 1, 'over': 1, 'just': 1, 'are': 1, 'tell': 1, 'drinking': 1, 'our': 1, 'where': 1, \"i'll\": 1, 'all': 1, \"isn't\": 1, 'make': 1, 'lover': 1, 'get': 1, 'radio': 1, 'give': 1, 'can': 1, 'club': 1, 'it': 1, 'out': 1, 'chance': 1, 'first': 1, 'table': 1, 'thrifty': 1, 'driver': 1, 'slow': 1, 'dance': 1, 'trust': 1, 'family': 1, 'week': 1, 'date': 1, 'leave': 1, 'at': 1, 'hand': 1, 'how': 1, 'eat': 1, 'about': 1, 'story': 1, 'sweet': 1, 'best': 1, 'let': 1, 'van': 1, 'shots': 1, 'place': 1, 'find': 1, 'kiss': 1, 'stop': 1, 'bar': 1, \"don't\": 2, 'mind': 2, 'know': 2, 'so': 2, 'start': 2, 'boy': 2, 'girl': 2, 'singing': 2, 'doing': 2, 'somebody': 2, 'handmade': 2, 'may': 2, 'that': 2, 'much': 2, 'grab': 2, 'was': 2, 'say': 2, 'waist': 2, 'want': 2, \"let's\": 2, 'not': 2, 'crazy': 2, 'go': 2, 'to': 2, 'fill': 2, 'hours': 2, 'push': 3, 'then': 3, 'put': 3, 'room': 3, 'magnet': 3, 'up': 3, 'pull': 3, 'last': 3, 'do': 3, 'smell': 3, 'although': 3, 'falling': 3, 'were': 3, 'night': 3, 'heart': 3, 'for': 3, 'bedsheets': 3, 'talk': 4, 'too': 5, 'is': 5, 'every': 6, 'new': 6, 'follow': 6, 'brand': 6, 'of': 6, 'i': 6, 'day': 6, 'lead': 6, 'shape': 6, 'discovering': 6, 'something': 6, 'we': 7, 'a': 8, 'like': 10, 'me': 10, 'now': 11, 'baby': 14, 'you': 16, 'be': 16, 'body': 17, 'the': 18, 'your': 21, 'with': 22, \"i'm\": 23, 'and': 23, 'love': 25, 'in': 27, 'my': 33, 'come': 37, 'on': 40}\n" + ] + } + ], + "source": [ + "word_freq2=dict(sorted_tups)\n", + "\n", + "print(word_freq2)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -186,7 +271,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + "version": "3.8.3" } }, "nbformat": 4,