Chapter 2: Generic way of selecting numerical or categorical attributes
parent
7e4f99085f
commit
bbe33f7039
|
@ -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)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue