Skip to content

Commit

Permalink
Update selection example
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Duberstein committed Apr 14, 2020
1 parent 08df599 commit 80e6c9a
Showing 1 changed file with 8 additions and 74 deletions.
Expand Up @@ -6,8 +6,6 @@
"source": [
"# Selecting data for use in Python: Singapore taxi location data\n",
"\n",
"*(About 5-10 minutes to read)*\n",
"\n",
"Often it's easier to use a visual application to draw a shape than define a geometry in code. Here we'll explore how pydeck can be used to select data and pass that selected data back to the Jupyter kernel for use in Pandas.\n",
"\n",
"## Contents\n",
Expand All @@ -28,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 57,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -47,7 +45,7 @@
},
{
"cell_type": "code",
"execution_count": 58,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -72,24 +70,9 @@
},
{
"cell_type": "code",
"execution_count": 59,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3df28f07550a420a9cc4394b2481bc88",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"DeckGLWidget(json_input='{\"initialViewState\": {\"bearing\": 0, \"latitude\": 1.3466294511520216, \"longitude\": 103.…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"outputs": [],
"source": [
"r.show()"
]
Expand All @@ -105,60 +88,11 @@
},
{
"cell_type": "code",
"execution_count": 71,
"execution_count": null,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>cellCount</th>\n",
" <th>cellWeight</th>\n",
" <th>maxCellWieght</th>\n",
" <th>totalCount</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>161</td>\n",
" <td>161</td>\n",
" <td>203</td>\n",
" <td>2662</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" cellCount cellWeight maxCellWieght totalCount\n",
"0 161 161 203 2662"
]
},
"execution_count": 71,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"pd.DataFrame([r.deck_widget.selected_data])"
"pd.DataFrame(r.selected_data)"
]
}
],
Expand All @@ -178,7 +112,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.4"
"version": "3.7.7"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 80e6c9a

Please sign in to comment.