{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Linear Regression for Pumpkins - Lesson 2" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
City NameTypePackageVarietySub VarietyGradeDateLow PriceHigh PriceMostly Low...Unit of SaleQualityConditionAppearanceStorageCropRepackTrans ModeUnnamed: 24Unnamed: 25
70BALTIMORENaN1 1/9 bushel cartonsPIE TYPENaNNaN9/24/1615.015.015.0...NaNNaNNaNNaNNaNNaNNNaNNaNNaN
71BALTIMORENaN1 1/9 bushel cartonsPIE TYPENaNNaN9/24/1618.018.018.0...NaNNaNNaNNaNNaNNaNNNaNNaNNaN
72BALTIMORENaN1 1/9 bushel cartonsPIE TYPENaNNaN10/1/1618.018.018.0...NaNNaNNaNNaNNaNNaNNNaNNaNNaN
73BALTIMORENaN1 1/9 bushel cartonsPIE TYPENaNNaN10/1/1617.017.017.0...NaNNaNNaNNaNNaNNaNNNaNNaNNaN
74BALTIMORENaN1 1/9 bushel cartonsPIE TYPENaNNaN10/8/1615.015.015.0...NaNNaNNaNNaNNaNNaNNNaNNaNNaN
\n", "

5 rows × 26 columns

\n", "
" ], "text/plain": [ " City Name Type Package Variety Sub Variety Grade \\\n", "70 BALTIMORE NaN 1 1/9 bushel cartons PIE TYPE NaN NaN \n", "71 BALTIMORE NaN 1 1/9 bushel cartons PIE TYPE NaN NaN \n", "72 BALTIMORE NaN 1 1/9 bushel cartons PIE TYPE NaN NaN \n", "73 BALTIMORE NaN 1 1/9 bushel cartons PIE TYPE NaN NaN \n", "74 BALTIMORE NaN 1 1/9 bushel cartons PIE TYPE NaN NaN \n", "\n", " Date Low Price High Price Mostly Low ... Unit of Sale Quality \\\n", "70 9/24/16 15.0 15.0 15.0 ... NaN NaN \n", "71 9/24/16 18.0 18.0 18.0 ... NaN NaN \n", "72 10/1/16 18.0 18.0 18.0 ... NaN NaN \n", "73 10/1/16 17.0 17.0 17.0 ... NaN NaN \n", "74 10/8/16 15.0 15.0 15.0 ... NaN NaN \n", "\n", " Condition Appearance Storage Crop Repack Trans Mode Unnamed: 24 \\\n", "70 NaN NaN NaN NaN N NaN NaN \n", "71 NaN NaN NaN NaN N NaN NaN \n", "72 NaN NaN NaN NaN N NaN NaN \n", "73 NaN NaN NaN NaN N NaN NaN \n", "74 NaN NaN NaN NaN N NaN NaN \n", "\n", " Unnamed: 25 \n", "70 NaN \n", "71 NaN \n", "72 NaN \n", "73 NaN \n", "74 NaN \n", "\n", "[5 rows x 26 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "pumpkins = pd.read_csv('../../data/US-pumpkins.csv')\n", "\n", "pumpkins = pumpkins[pumpkins['Package'].str.contains('bushel', case=True, regex=True)]\n", "\n", "pumpkins.head()" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "City Name 0\n", "Type 406\n", "Package 0\n", "Variety 0\n", "Sub Variety 167\n", "Grade 415\n", "Date 0\n", "Low Price 0\n", "High Price 0\n", "Mostly Low 24\n", "Mostly High 24\n", "Origin 0\n", "Origin District 396\n", "Item Size 114\n", "Color 145\n", "Environment 415\n", "Unit of Sale 404\n", "Quality 415\n", "Condition 415\n", "Appearance 415\n", "Storage 415\n", "Crop 415\n", "Repack 0\n", "Trans Mode 415\n", "Unnamed: 24 415\n", "Unnamed: 25 391\n", "dtype: int64" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "pumpkins.isnull().sum()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Month Package Low Price High Price Price\n", "70 9 1 1/9 bushel cartons 15.00 15.0 13.50\n", "71 9 1 1/9 bushel cartons 18.00 18.0 16.20\n", "72 10 1 1/9 bushel cartons 18.00 18.0 16.20\n", "73 10 1 1/9 bushel cartons 17.00 17.0 15.30\n", "74 10 1 1/9 bushel cartons 15.00 15.0 13.50\n", "... ... ... ... ... ...\n", "1738 9 1/2 bushel cartons 15.00 15.0 30.00\n", "1739 9 1/2 bushel cartons 13.75 15.0 28.75\n", "1740 9 1/2 bushel cartons 10.75 15.0 25.75\n", "1741 9 1/2 bushel cartons 12.00 12.0 24.00\n", "1742 9 1/2 bushel cartons 12.00 12.0 24.00\n", "\n", "[415 rows x 5 columns]\n" ] } ], "source": [ "\n", "# A set of new columns for a new dataframe. Filter out nonmatching columns\n", "columns_to_select = ['Package', 'Low Price', 'High Price', 'Date']\n", "pumpkins = pumpkins.loc[:, columns_to_select]\n", "\n", "# Get an average between low and high price for the base pumpkin price\n", "price = (pumpkins['Low Price'] + pumpkins['High Price']) / 2\n", "\n", "# Convert the date to its month only\n", "month = pd.DatetimeIndex(pumpkins['Date']).month\n", "\n", "# Create a new dataframe with this basic data\n", "new_pumpkins = pd.DataFrame({'Month': month, 'Package': pumpkins['Package'], 'Low Price': pumpkins['Low Price'],'High Price': pumpkins['High Price'], 'Price': price})\n", "\n", "# Convert the price if the Package contains fractional bushel values\n", "new_pumpkins.loc[new_pumpkins['Package'].str.contains('1 1/9'), 'Price'] = price/(1 + 1/9)\n", "\n", "new_pumpkins.loc[new_pumpkins['Package'].str.contains('1/2'), 'Price'] = price/(1/2)\n", "\n", "print(new_pumpkins)\n", "\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAAcXklEQVR4nO3dfZRcdZ3n8fdnKg80GbAJdLKkSQyTycnoEodoLQlGOXE0JiauZNiZFRbOoqPkuIddnWE3M7BwxmEOOcTJLOJZ96wbkBFHJjrjYGTFMWRRhlkXohUTCYoRkAh0kPQY4gO2Etrv/lG3YqW6bj3d7qrum8/rnD5d9btP3/u7v/p09a3bfRURmJlZfv1arwswM7OJ5aA3M8s5B72ZWc456M3Mcs5Bb2aWc9N6XUA9Z511VixcuLDXZZiZTRl79uz554gYqDdtUgb9woULKZVKvS7DzGzKkPT9tGk+dWNmlnMOejOznHPQm5nlnIPezCznHPRmZjnX9KobSXcAbwcOR8R5SdtW4F8DLwFPAu+OiKN1ll0LfAQoALdHxJbxK717Lr/tIb765JHjz1cums1dV104Zr7VtzzA44dfPP588ZxZ7LpmVTdKTLVj7xBbdx7g0NER5vX3sWnNEjYsG+xpTWbWXa28o/8EsLambRdwXkS8BvgucF3tQpIKwP8A3ga8GrhM0qszVdsDtSEP8NUnj3D5bQ+d0FYb8gCPH36R1bc8MNElptqxd4jr7t7P0NERAh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gHZIOAp+mfMrmI/S+n8bUJelTPe4rImIo+X4Y+Fyy/Z5n1VQO+sqNx0m+f76HtQDHD2LF7wKPps07QdsX8HHgsYi4pWpSz/oqraZJ0FcDkvqTx33AasqfH3yF8o3soft9Va+m71SFhCif3+1aX0XEdRFxTkQsBC4FvhwRl9PDfmpQ1xW97CtJsySdVnkMvDXZfu+zKiIm/RewnfKv98conw98D+XzhPcDjwP/B5g9CWr6a2A/8Ajlg3t2l2t6A+VfCx8B9iVf63rZVw1q6nVfvYbyDe0fofxi/NOk/TeArwFPAH8HzJwENX056atHgU8Bv97NvqqqbxXwhV73U5O6etZXSZ98M/n6FnB90t7TrIoI/wsEM7O8m8qnbszMrAUOejOznHPQm5nlnIPezCznHPRmZjnnoDczyzkHvZlZzv1/N8s9l//aWz4AAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "\n", "price = new_pumpkins.Price\n", "month = new_pumpkins.Month\n", "plt.scatter(price, month)\n", "plt.show()\n" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Text(0, 0.5, 'Pumpkin Price')" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX4AAAEJCAYAAACT/UyFAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAARAElEQVR4nO3de5AlZX3G8e8joKigiIwbVNYVQ6ErwcVaiRW0CgUNikEQKxFTijHJahlUSsvUqknE/LVE0KoYNVkDigloNCoQLt5AxUuCLrrhIhqUQgMiLBGE0goR+OWP0+sMszOzZ8ft0zO830/VqTndfc7phwae6XlPX1JVSJLa8aChA0iSJsvil6TGWPyS1BiLX5IaY/FLUmMsfklqzK5DBxjHPvvsU6tWr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W3Mboxy3xna36jqm7sruK4uVuXNHGewCXd3/nAacDhwKPHfM/dM57fy/z/X437OqlX7vFL93cm8M6qumrW/K8AfwijI3SA27Zzs/m7gD37CCj9utzjkGaoqhuBv51j0SnAmd0FuX7B6HaLC33O/yT5WnfDkouBC3d2VmmxvGSDJDXGoR5JaozFL0mNsfglqTEWvyQ1xuKXpMZY/JLUGItfkhpj8UtSY/4fZDFW+b6+4WkAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "\n", "new_pumpkins.groupby(['Month'])['Price'].mean().plot(kind='bar')\n", "plt.ylabel(\"Pumpkin Price\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "interpreter": { "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6" }, "kernelspec": { "display_name": "Python 3.7.0 64-bit ('3.7')", "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.11.1" }, "metadata": { "interpreter": { "hash": "70b38d7a306a849643e446cd70466270a13445e5987dfa1344ef2b127438fa4d" } }, "orig_nbformat": 2 }, "nbformat": 4, "nbformat_minor": 2 }