{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Weekly exercise 8: Simple Matplotlib exercises\n", "\n", "Follow the compulsory QuantEcon DataScience tutorial at\n", "[https://datascience.quantecon.org/applications/visualization_rules.html](https://datascience.quantecon.org/applications/visualization_rules.html)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 1\n", "\n", "Import the necessary libraries" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# hint: we need pd and plt\n", "@@@\n", "\n", "# print the graphs in the notebook\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 2\n", "\n", "Import the dataset from [https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/07_Visualization/Tips/tips.csv](https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/07_Visualization/Tips/tips.csv)\n", "\n", "Assign it to a variable called tips\n", "\n", "Take the first look at the dataset" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# write your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 3\n", "\n", "Delete the Unnamed 0 column" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# write your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 4\n", "\n", "Plot the total_bill column histogram:\n", "\n", "- create the histogram plot object \n", "- set axes labels and plot title \n", "\n", "\n", "Follow [https://matplotlib.org/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py](https://matplotlib.org/gallery/pyplots/pyplot_text.html#sphx-glr-gallery-pyplots-pyplot-text-py)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# write your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 5\n", "\n", "Create a scatter plot presenting the relationship between total_bill and tip,\n", "using one function." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# write your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 6\n", "\n", "Create one 3 by 3 image with the relationship of total_bill, tip and size.\n", "Again, use just one function." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# write your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 7\n", "\n", "Present the relationship between days and total_bill value.\n", "Use `jitter = True` argument for visual appeal." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# write your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Task 8\n", "\n", "Create two scatterplot graphs, one for Male and another for Female, presenting the total_bill value and tip relationship, differing by smoker or non-smoker. Add a legend." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "hide-output": false }, "outputs": [], "source": [ "# write your code here" ] } ], "metadata": { "date": 1627475014.55644, "filename": "exercise08.rst", "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", "version": "3.7.6" }, "title": "Weekly exercise 8: Simple Matplotlib exercises" }, "nbformat": 4, "nbformat_minor": 4 }