From f2d70bc66c228cfc1b44158666cd5f92b9d7b631 Mon Sep 17 00:00:00 2001 From: Dybovsky98 Date: Tue, 9 Nov 2021 00:56:21 +0100 Subject: [PATCH] cate --- .../python-practice-assignment.ipynb | 172 ++++++++++-------- 1 file changed, 98 insertions(+), 74 deletions(-) diff --git a/0-starting-with-python/python-practice-assignment/python-practice-assignment.ipynb b/0-starting-with-python/python-practice-assignment/python-practice-assignment.ipynb index e329b25..44f27cd 100644 --- a/0-starting-with-python/python-practice-assignment/python-practice-assignment.ipynb +++ b/0-starting-with-python/python-practice-assignment/python-practice-assignment.ipynb @@ -4,7 +4,24 @@ "cell_type": "code", "execution_count": 1, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: Ignoring invalid distribution -ffi (c:\\users\\adid1\\anaconda3\\lib\\site-packages)\n", + "WARNING: You are using pip version 21.1.2; however, version 21.3.1 is available.\n", + "You should consider upgrading via the 'c:\\users\\adid1\\anaconda3\\python.exe -m pip install --upgrade pip' command.\n" + ] + } + ], "source": [ "!pip install jovian --upgrade --quiet" ] @@ -13,7 +30,18 @@ "cell_type": "code", "execution_count": 2, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "application/javascript": "if (window.IPython && IPython.notebook.kernel) IPython.notebook.kernel.execute('jovian.utils.jupyter.get_notebook_name_saved = lambda: \"' + IPython.notebook.notebook_name + '\"')", + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "import jovian" ] @@ -34,9 +62,7 @@ "outputs": [ { "data": { - "application/javascript": [ - "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})" - ], + "application/javascript": "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})", "text/plain": [ "" ] @@ -44,28 +70,22 @@ "metadata": {}, "output_type": "display_data" }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[jovian] Attempting to save notebook..\u001b[0m\n", - "[jovian] Please enter your API key ( from https://jovian.ml/ ):\u001b[0m\n", - "API KEY: ········\n", - "[jovian] Updating notebook \"tusharnankani3/python-practice-assignment\" on https://jovian.ml/\u001b[0m\n", - "[jovian] Uploading notebook..\u001b[0m\n", - "[jovian] Capturing environment..\u001b[0m\n", - "[jovian] Committed successfully! https://jovian.ml/tusharnankani3/python-practice-assignment\u001b[0m\n" - ] - }, { "data": { + "application/javascript": "if (window.IPython && IPython.notebook.kernel) IPython.notebook.kernel.execute('jovian.utils.jupyter.get_notebook_name_saved = lambda: \"' + IPython.notebook.notebook_name + '\"')", "text/plain": [ - "'https://jovian.ml/tusharnankani3/python-practice-assignment'" + "" ] }, - "execution_count": 4, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[jovian] Error: Failed to read the Jupyter notebook. Please re-run this cell to try again. If the issue persists, provide the \"filename\" argument to \"jovian.commit\" e.g. \"jovian.commit(filename='my-notebook.ipynb')\"\n" + ] } ], "source": [ @@ -184,9 +204,7 @@ "outputs": [ { "data": { - "application/javascript": [ - "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})" - ], + "application/javascript": "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})", "text/plain": [ "" ] @@ -194,26 +212,22 @@ "metadata": {}, "output_type": "display_data" }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[jovian] Attempting to save notebook..\u001b[0m\n", - "[jovian] Updating notebook \"tusharnankani3/python-practice-assignment\" on https://jovian.ml/\u001b[0m\n", - "[jovian] Uploading notebook..\u001b[0m\n", - "[jovian] Capturing environment..\u001b[0m\n", - "[jovian] Committed successfully! https://jovian.ml/tusharnankani3/python-practice-assignment\u001b[0m\n" - ] - }, { "data": { + "application/javascript": "if (window.IPython && IPython.notebook.kernel) IPython.notebook.kernel.execute('jovian.utils.jupyter.get_notebook_name_saved = lambda: \"' + IPython.notebook.notebook_name + '\"')", "text/plain": [ - "'https://jovian.ml/tusharnankani3/python-practice-assignment'" + "" ] }, - "execution_count": 12, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "[jovian] Error: Failed to read the Jupyter notebook. Please re-run this cell to try again. If the issue persists, provide the \"filename\" argument to \"jovian.commit\" e.g. \"jovian.commit(filename='my-notebook.ipynb')\"\n" + ] } ], "source": [ @@ -403,9 +417,7 @@ "outputs": [ { "data": { - "application/javascript": [ - "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})" - ], + "application/javascript": "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})", "text/plain": [ "" ] @@ -485,9 +497,7 @@ "outputs": [ { "data": { - "application/javascript": [ - "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})" - ], + "application/javascript": "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})", "text/plain": [ "" ] @@ -600,9 +610,7 @@ "outputs": [ { "data": { - "application/javascript": [ - "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})" - ], + "application/javascript": "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})", "text/plain": [ "" ] @@ -644,7 +652,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -664,16 +672,27 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 16, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "10" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "number_of_tweets = len(tweets)\n" + "number_of_tweets = len(tweets)" ] }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -683,25 +702,34 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ - "sample_tweet = tweets[0]" + "import random" ] }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 28, + "metadata": {}, + "outputs": [], + "source": [ + "sample_tweet = random.sample(tweets, 1)" + ] + }, + { + "cell_type": "code", + "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'Wow, what a great day today!! #sunshine'" + "['Freecodecamp has great coding tutorials. #skillup']" ] }, - "execution_count": 37, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -712,7 +740,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -728,16 +756,16 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "True" + "False" ] }, - "execution_count": 39, + "execution_count": 31, "metadata": {}, "output_type": "execute_result" } @@ -748,7 +776,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -767,7 +795,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 33, "metadata": {}, "outputs": [ { @@ -784,7 +812,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -793,7 +821,7 @@ }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -810,7 +838,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -826,7 +854,7 @@ }, { "cell_type": "code", - "execution_count": 45, + "execution_count": 37, "metadata": {}, "outputs": [ { @@ -874,9 +902,7 @@ "outputs": [ { "data": { - "application/javascript": [ - "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})" - ], + "application/javascript": "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})", "text/plain": [ "" ] @@ -1001,9 +1027,7 @@ "outputs": [ { "data": { - "application/javascript": [ - "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})" - ], + "application/javascript": "window.require && require([\"base/js/namespace\"],function(Jupyter){Jupyter.notebook.save_checkpoint()})", "text/plain": [ "" ] @@ -1047,7 +1071,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.7.7" } }, "nbformat": 4,