Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fea/sidebar api change #262

Merged
merged 23 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/source/examples/Mortgage_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
"metadata": {},
"outputs": [],
"source": [
"d = cux_df.dashboard([chart0, chart1, chart4], layout=feature_and_base, theme=cuxfilter.themes.dark, title=\"Ajay's Dashboard\")"
"d = cux_df.dashboard([chart0], sidebar=[chart1, chart4], layout=feature_and_base, theme=cuxfilter.themes.dark, title=\"Ajay's Dashboard\")"
]
},
{
Expand All @@ -154,7 +154,7 @@
"outputs": [],
"source": [
"#add more charts\n",
"d.add_charts([chart2, chart3])"
"d.add_charts(charts=[chart2], sidebar=[chart3])"
]
},
{
Expand Down Expand Up @@ -243,7 +243,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/NYC_taxi_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
"metadata": {},
"outputs": [],
"source": [
"d = cux_df.dashboard([chart1, chart2, chart3, chart4], layout=feature_and_double_base, theme=cuxfilter.themes.rapids, title= 'NYC TAXI DATASET')"
"d = cux_df.dashboard([chart1, chart2, chart3], sidebar=[chart4], layout=feature_and_double_base, theme=cuxfilter.themes.rapids, title= 'NYC TAXI DATASET')"
]
},
{
Expand Down Expand Up @@ -289,7 +289,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/source/examples/auto_accidents_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"metadata": {},
"outputs": [],
"source": [
"d = cux_df.dashboard([chart1, chart3, chart2], layout=cuxfilter.layouts.feature_and_base,theme = cuxfilter.themes.light, title='Auto Accident Dataset')"
"d = cux_df.dashboard([chart1, chart2], sidebar=[chart3], layout=cuxfilter.layouts.feature_and_base,theme = cuxfilter.themes.light, title='Auto Accident Dataset')"
]
},
{
Expand Down Expand Up @@ -231,7 +231,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down
130 changes: 123 additions & 7 deletions notebooks/Mortgage_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,120 @@
"metadata": {},
"outputs": [],
"source": [
"cux_df = cuxfilter.DataFrame.from_arrow(DATA_DIR + '/146M_predictions_v2.arrow')"
"cux_df = cuxfilter.DataFrame.from_arrow(DATA_DIR + '/146M_predictions.arrow')"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"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>zip</th>\n",
" <th>dti</th>\n",
" <th>current_actual_upb</th>\n",
" <th>borrower_credit_score</th>\n",
" <th>loan_id</th>\n",
" <th>delinquency_12_prediction</th>\n",
" <th>seller_name</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>85.0</td>\n",
" <td>43.0</td>\n",
" <td>113490.289062</td>\n",
" <td>772.0</td>\n",
" <td>1.565209e+11</td>\n",
" <td>0.186399</td>\n",
" <td>30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>980.0</td>\n",
" <td>23.0</td>\n",
" <td>127555.281250</td>\n",
" <td>772.0</td>\n",
" <td>2.668867e+11</td>\n",
" <td>0.174487</td>\n",
" <td>43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>206.0</td>\n",
" <td>32.0</td>\n",
" <td>164793.046875</td>\n",
" <td>778.0</td>\n",
" <td>5.811654e+11</td>\n",
" <td>0.180703</td>\n",
" <td>30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>548.0</td>\n",
" <td>27.0</td>\n",
" <td>149874.484375</td>\n",
" <td>773.0</td>\n",
" <td>4.559486e+11</td>\n",
" <td>0.184124</td>\n",
" <td>30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>939.0</td>\n",
" <td>42.0</td>\n",
" <td>222159.046875</td>\n",
" <td>800.0</td>\n",
" <td>8.630428e+11</td>\n",
" <td>0.180727</td>\n",
" <td>46</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" zip dti current_actual_upb borrower_credit_score loan_id \\\n",
"0 85.0 43.0 113490.289062 772.0 1.565209e+11 \n",
"1 980.0 23.0 127555.281250 772.0 2.668867e+11 \n",
"2 206.0 32.0 164793.046875 778.0 5.811654e+11 \n",
"3 548.0 27.0 149874.484375 773.0 4.559486e+11 \n",
"4 939.0 42.0 222159.046875 800.0 8.630428e+11 \n",
"\n",
" delinquency_12_prediction seller_name \n",
"0 0.186399 30 \n",
"1 0.174487 43 \n",
"2 0.180703 30 \n",
"3 0.184124 30 \n",
"4 0.180727 46 "
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cux_df.data.head()"
]
Expand Down Expand Up @@ -151,14 +257,24 @@
"metadata": {},
"outputs": [],
"source": [
"d = cux_df.dashboard([chart0, chart1, chart2, chart3], layout=cuxfilter.layouts.feature_and_base, theme=cuxfilter.themes.dark, title=\"Mortgage Dashboard\")"
"d = cux_df.dashboard([chart0, chart2], sidebar=[chart1], layout=cuxfilter.layouts.feature_and_base, theme=cuxfilter.themes.dark, title=\"Mortgage Dashboard\")\n",
"d.add_charts(sidebar=[chart3])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"d.show()"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"#View Individual charts - uncomment below line\n",
"# chart0.view()"
Expand Down Expand Up @@ -233,9 +349,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.7.6 64-bit ('cuxfilter_dev': conda)",
"display_name": "Python 3",
"language": "python",
"name": "python37664bitcuxfilterdevconda84b99a2bb489494a97e6ceb26fbebb21"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -247,7 +363,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.8.8"
}
},
"nbformat": 4,
Expand Down
Loading