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

add a fix to #764 #766

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,10 @@
"\n",
"Let's use it to answer the question:\n",
"\n",
"**What are average values of numerical features for churned users?**\n"
"**What are average values of numerical features for churned users?**\n",
"\n",
"\n",
"Here we'll resort to an additional method `select_dtypes` to select all numeric columns."
]
},
{
Expand All @@ -299,14 +302,15 @@
"metadata": {},
"outputs": [],
"source": [
"df[df[\"Churn\"] == 1].mean()"
"df.select_dtypes(include=np.number)[df[\"Churn\"] == 1].mean()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"**How much time (on average) do churned users spend on the phone during daytime?**"
"**How much time (on average) do churned users spend on the phone during daytime?**\n",
"\n"
]
},
{
Expand Down Expand Up @@ -396,7 +400,7 @@
"metadata": {},
"outputs": [],
"source": [
"df.apply(np.max)"
"df.apply('max')"
]
},
{
Expand Down Expand Up @@ -522,7 +526,7 @@
"source": [
"columns_to_show = [\"Total day minutes\", \"Total eve minutes\", \"Total night minutes\"]\n",
"\n",
"df.groupby([\"Churn\"])[columns_to_show].agg([np.mean, np.std, np.min, np.max])"
"df.groupby([\"Churn\"])[columns_to_show].agg(['mean', 'std', 'min', 'max'])"
]
},
{
Expand Down Expand Up @@ -809,7 +813,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -823,9 +827,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -857,4 +857,4 @@ This section has been moved to Kaggle, please explore [this Notebook](https://ww
- ["Convex Optimization" by Stephen Boyd](https://www.amazon.com/Convex-Optimization-Stephen-Boyd/dp/0521833787)
- "Command-line Tools can be 235x Faster than your Hadoop Cluster" [post](https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html)
- Benchmarking various ML algorithms on Criteo 1TB dataset on [GitHub](https://github.com/rambler-digital-solutions/criteo-1tb-benchmark)
- [VW on FastML.com](http://fastml.com/blog/categories/vw/)
- [VW on FastML.com](http://fastml.com/blog/categories/vw/)
Loading