Skip to content
Snippets Groups Projects
python-data-4-pandas.ipynb 27.8 KiB
Newer Older
nbgitpuller's avatar
nbgitpuller committed
    "scrolled": true
   },
   "outputs": [],
   "source": [
nbgitpuller's avatar
nbgitpuller committed
    "data[data > 2] = 2\n",
    "data.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
nbgitpuller's avatar
nbgitpuller committed
    "What we just did is called **boolean indexing**."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
nbgitpuller's avatar
nbgitpuller committed
    "### Exercise 7\n",
    "Let's load again our file with home prices and filter out homes based on our preference:\n",
    "1. Load up the file `data/homes.csv`\n",
    "2. The data contains some duplicates. Filter them out.\n",
    "3. Let's say that the most we can spend on a house is £150. Keep only houses that have a **sell**ing price less than £150 and remove the rest\n",
    "4. Select only houses that have 4 or more bedrooms\n",
    "5. Select only houses that have 3 or more baths\n",
ignat's avatar
ignat committed
    "\n",
    "You should end up with only 2 houses"
ignat's avatar
ignat committed
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
ignat's avatar
ignat committed
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
nbgitpuller's avatar
nbgitpuller committed
   "version": "3.6.6"
ignat's avatar
ignat committed
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}