Chapter 2: Generic way of selecting numerical or categorical attributes

main
pannoos 2017-10-15 04:01:07 -07:00
parent 7e4f99085f
commit bbe33f7039
1 changed files with 2 additions and 2 deletions

View File

@ -689,7 +689,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"housing_num = housing.drop(\"ocean_proximity\", axis=1)" "housing_num = housing.select_dtypes(include=[np.number])"
] ]
}, },
{ {
@ -797,7 +797,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"housing_cat = housing[\"ocean_proximity\"]\n", "housing_cat = housing.select_dtypes(exclude=[np.number])\n",
"housing_cat.head(10)" "housing_cat.head(10)"
] ]
}, },