Browse Source

Done with notebook for article

WillKoehrsen 6 years ago
parent
commit
f16226a5aa
2 changed files with 17 additions and 16 deletions
  1. 8 8
      widgets/Widgets Overview-Copy1.ipynb
  2. 9 8
      widgets/Widgets-Overview.ipynb

+ 8 - 8
widgets/Widgets Overview-Copy1.ipynb

@@ -929,23 +929,24 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 16,
+   "execution_count": 60,
    "metadata": {
     "ExecuteTime": {
-     "end_time": "2019-01-27T13:30:43.876463Z",
-     "start_time": "2019-01-27T13:30:43.844232Z"
-    }
+     "end_time": "2019-01-27T22:01:03.543395Z",
+     "start_time": "2019-01-27T22:01:03.500748Z"
+    },
+    "scrolled": false
    },
    "outputs": [
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "6e4be11736714c6bab3cf025f616190e",
+       "model_id": "3f5ebf2265054ff79f03c4ee18addb65",
        "version_major": 2,
        "version_minor": 0
       },
       "text/plain": [
-       "interactive(children=(Dropdown(description='column', options=('claps', 'views', 'fans', 'reads'), value='claps…"
+       "interactive(children=(IntSlider(value=50000, description='x', max=100000, min=10, step=10), Dropdown(descripti…"
       ]
      },
      "metadata": {},
@@ -955,8 +956,7 @@
    "source": [
     "# Interact with specification of arguments\n",
     "@interact\n",
-    "def show_articles_more_than(column=['claps', 'views', 'fans', 'reads'], \n",
-    "                            x=(10, 100000, 10)):\n",
+    "def show_articles_more_than(x=(10, 100000, 10), column=['claps', 'views', 'fans', 'reads']):\n",
     "    return df.loc[df[column] > x]"
    ]
   },

+ 9 - 8
widgets/Widgets-Overview.ipynb

@@ -780,23 +780,23 @@
   },
   {
    "cell_type": "code",
-   "execution_count": 8,
+   "execution_count": 32,
    "metadata": {
     "ExecuteTime": {
-     "end_time": "2019-01-27T15:06:26.455863Z",
-     "start_time": "2019-01-27T15:06:26.375634Z"
+     "end_time": "2019-01-27T22:00:31.196061Z",
+     "start_time": "2019-01-27T22:00:31.148769Z"
     }
    },
    "outputs": [
     {
      "data": {
       "application/vnd.jupyter.widget-view+json": {
-       "model_id": "66c1cc01b4c34cddb206d110a76dc51a",
+       "model_id": "0d609788ff3c4aaa88f0891b4c86f7eb",
        "version_major": 2,
        "version_minor": 0
       },
       "text/plain": [
-       "interactive(children=(Dropdown(description='column', options=('claps', 'days_since_publication', 'fans', 'num_…"
+       "interactive(children=(IntSlider(value=3000, description='x', max=5000, min=1000, step=100), Dropdown(descripti…"
       ]
      },
      "metadata": {},
@@ -805,9 +805,10 @@
    ],
    "source": [
     "@interact\n",
-    "def show_titles_more_than(column=list(df.select_dtypes('number').columns), \n",
-    "                          x=(1000, 5000, 100)):\n",
-    "    display(HTML(f'<h2>Showing articles with more than {x} {column}<h2>'))\n",
+    "def show_titles_more_than(x=(1000, 5000, 100),\n",
+    "                          column=list(df.select_dtypes('number').columns), \n",
+    "                          ):\n",
+    "    # display(HTML(f'<h2>Showing articles with more than {x} {column}<h2>'))\n",
     "    display(df.loc[df[column] > x, ['title', 'published_date', 'read_time', 'tags', 'views', 'reads']])"
    ]
   },