download stock price of a few companies and plot them using Python.
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Python Basics (Instructor: Dr. Milad Baghersad)\n", "\n", "## Module 7: Data Analysis with Python Part 2\n", "\n", "- Reference: McKinney, Wes (2018) Python for data analysis: Data wrangling with Pandas, NumPy, and IPython, Second Edition, O'Reilly Media, Inc. ISBN-13: 978-1491957660 ISBN-10: 1491957662\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# a. Visualization\n", "___\n", "___\n", "___\n", "___\n", "### matplotlib:\n", "Matplotlib is a Python 2D plotting library which produces publication quality figures in a variety of hardcopy formats and interactive environments across platforms. \n", "https://matplotlib.org/" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#%matplotlib notebook" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# above code creates interactive plots in the Jupyter notebook" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data = np.arange(10)\n", "data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data_squared = data*data\n", "data_squared" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false }, "outputs": [], "source": [ "#line plot\n", "plt.plot(data,data_squared)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.close()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,color ='green')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#adding lables\n", "plt.plot(data,data_squared,'green')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--') #a green dashed line. \n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,linestyle='--', color='red') \n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#adding title\n", "plt.plot(data,data_squared,'g--') \n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n", "plt.title(\"My plot\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Saving plots" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--') #a green dashed line. \n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n", "plt.title(\"My plot\")\n", "plt.savefig(\"fig1.png\", dpi=400)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--') #a green dashed line. \n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n", "plt.title(\"My plot\")\n", "plt.savefig(\"fig1.pdf\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Plotting multiple graphs" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "data = np.arange(10)\n", "data_squared = data*data\n", "data_cubed = data*data*data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(data)\n", "print(data_squared)\n", "print(data_cubed)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--')\n", "plt.plot(data,data_cubed,'r--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared/cubed value\") \n", "plt.title(\"My plot\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "- seprating plots" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.axes([0,0,1,1]) #[x_lc, y_lc, width, height]\n", "plt.plot(data,data_squared,'g--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n", "plt.title(\"My squared plot\")\n", "\n", "plt.axes([1.2,0,1,1])\n", "plt.plot(data,data_cubed,'r--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Cubed value\") \n", "plt.title(\"My cubed plot\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.subplot(1,2,1) #(number of rows, number of columns, plot number)\n", "plt.plot(data,data_squared,'g--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n", "plt.title(\"My squared plot\")\n", "\n", "plt.subplot(1,2,2)\n", "plt.plot(data,data_cubed,'r--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Cubed value\") \n", "plt.title(\"My cubed plot\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "___\n", "___\n", "### Adjusting axes" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n", "plt.title(\"My squared plot\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#only show values from 2 to 6\n", "plt.plot(data,data_squared,'g--')\n", "plt.axis([2,6,0,40]) #[xmin, xmax, ymin, ymax]\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared value\") \n", "plt.title(\"My squared plot\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### adding legend" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--')\n", "plt.plot(data,data_cubed,'r--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared/cubed value\") \n", "plt.title(\"My plot\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#adding legend\n", "plt.plot(data,data_squared,'g--', label ='squared')\n", "plt.plot(data,data_cubed,'r--', label ='cubed')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared/cubed value\") \n", "plt.title(\"My plot\")\n", "\n", "plt.legend(loc='upper left') ##adds the labels" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### annotate instead of label\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--')\n", "plt.plot(data,data_cubed,'r--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared/cubed value\") \n", "plt.title(\"My plot\")\n", "\n", "plt.annotate('squared', xy=(8,64), xytext=(7,200), arrowprops = {'arrowstyle': '->'})\n", "plt.annotate('cubed', xy=(6,216), xytext=(4,350), arrowprops = {'arrowstyle': '->'})" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--')\n", "plt.plot(data,data_cubed,'r--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared/cubed value\") \n", "plt.title(\"My plot\")\n", "\n", "plt.annotate('squared', xy=(8,64), xytext=(7,200), arrowprops = {'arrowstyle': '->'}, bbox = dict(boxstyle = 'round,pad=0.1', fc = 'green', alpha = 0.1))\n", "plt.annotate('cubed', xy=(6,216), xytext=(4,350), arrowprops = {'arrowstyle': '->'}, bbox = dict(boxstyle = 'round,pad=0.1', fc = 'green', alpha = 0.1))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### change the style" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.close()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(data,data_squared,'g--')\n", "plt.plot(data,data_cubed,'r--')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared/cubed value\") \n", "plt.title(\"My plot\")\n", "\n", "plt.style.use('classic')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.style.available" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### scatter plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.scatter(data,data_squared, color='green')\n", "plt.scatter(data,data_cubed, color='red')\n", "plt.xlabel('Value')\n", "plt.ylabel(\"Squared/cubed value\") \n", "plt.title(\"My plot\")\n", "\n", "plt.style.use('classic')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### example for scatter plot:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import pandas_datareader.data as web\n", "all_data = {ticker: web.get_data_yahoo(ticker) for ticker in ['AAPL', 'IBM', 'MSFT', 'GOOG']}\n", "price = pd.DataFrame({ticker: data['Adj Close'] for ticker, data in all_data.items()})\n", "returns = price.pct_change()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "returns.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "returns.mean()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "returns.std()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.scatter(returns.mean(), returns.std())" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.scatter(returns.mean(), returns.std())\n", "plt.xlabel('Expected returns')\n", "plt.ylabel('Standard deviations')\n", "plt.title('Simple risk portfolio')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.scatter(returns.mean(), returns.std())\n", "plt.xlabel('Expected returns')\n", "plt.ylabel('Standard deviations')\n", "plt.title('Simple risk portfolio')\n", "\n", "\n", "for ticker, x, y in zip(returns.columns, returns.mean(), returns.std()):\n", " plt.annotate(ticker, xy = (x, y), xytext = (60, 0),\n", " textcoords = 'offset points', ha = 'right', va = 'bottom',\n", " bbox = dict(boxstyle = 'round,pad=0.05', fc = 'green', alpha = 0.1),\n", " arrowprops = {'arrowstyle': '->'})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "___\n", "___\n", "___\n", "___\n", "# seaborn (seaborn: statistical data visualization)\n", "https://seaborn.pydata.org/ :\n", "\n", "\n", "Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "returns.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import statsmodels.api as sm\n", "y = returns['AAPL']\n", "x = returns[['IBM', 'MSFT', 'GOOG']]\n", "model = sm.OLS(y,x, missing='drop')\n", "result = model.fit()\n", "print(result.summary())" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.lmplot(x='AAPL', y = 'IBM', data=returns)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#residuals\n", "sns.residplot(x='AAPL', y = 'IBM', data=returns)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Use seaborn to visualize data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "dealership_data = pd.read_csv(\"dealership.csv\", delimiter=\",\")\n", "dealership_data['Profit']= dealership_data['Profit'].replace('[\\$,]', '', regex=True).astype('float')\n", "dealership_data.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.stripplot(y='Profit', data=dealership_data)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.stripplot(x='Location', y='Profit', data=dealership_data)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.swarmplot(x='Location', y='Profit', data=dealership_data)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.swarmplot(x='Vehicle-Type', y='Profit', data=dealership_data)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.swarmplot(x='Vehicle-Type', y='Profit', data=dealership_data, hue='Location')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.boxplot(x='Vehicle-Type', y='Profit', data=dealership_data)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.violinplot(x='Vehicle-Type', y='Profit', data=dealership_data)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### pairplot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.pairplot(dealership_data)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sns.pairplot(dealership_data, hue=\"Location\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# b. Data Cleaning and Preparation\n", "___\n", "___\n", "___\n", "___\n", "### Why data cleaning?\n", "- Sometimes the way that data is stored in files or databases is not in the right format for a particular task.\n", "- Inappropriate variable name\n", "- Wrong data type\n", "- Missing data\n", "- Duplicate data\n", "\n", "### Example:" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data = pd.read_csv('Sell_data.csv')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data = pd.read_csv('Sell_data.csv', index_col='transaction_id')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.tail()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#changing name of columns: \n", "sell_data.rename(columns={'Customer id':'customer_id', 'Profit': 'profit', 'Vehicle-Type':'vehicle_type',\n", " 'Location': 'location', 'Previous': 'previous'}, inplace=True)\n", "sell_data.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.info()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#inspect columns\n", "sell_data['customer_id'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['age'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['age'].value_counts(dropna=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data[sell_data.age == '-']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.loc[sell_data.age == '-', 'age']= np.NaN\n", "sell_data.loc[sell_data.age == '---', 'age']= np.NaN\n", "sell_data.loc[sell_data.age == '0', 'age']= np.NaN" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['age'].value_counts(dropna=False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['age'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['age'] = sell_data['age'].astype(float)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['age'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['profit'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['profit'] = sell_data['profit'].replace('\\$', '', regex=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['profit'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['profit'] = sell_data['profit'].astype(float) #Error" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['profit'] = sell_data['profit'].replace(',', '', regex=True).astype(float)\n", "sell_data['profit'].head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['location'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['location'].value_counts(dropna = False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#you can check for outliers using boxplot\n", "sell_data.boxplot(column='profit', by='location')\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['vehicle_type'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['vehicle_type'].value_counts(dropna = False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.loc[sell_data.vehicle_type == 'Nan', 'vehicle_type']= np.NaN" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['vehicle_type'].value_counts(dropna = False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['previous'].describe()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['previous'].value_counts(dropna = False)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.loc[sell_data.previous == -1, 'previous']= np.NaN" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data['previous'].value_counts(dropna = False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Handling Missing Data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.info()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Method 1: drop NaNs\n", "sell_data.dropna()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned = sell_data.dropna()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Supposeyou want to keep only rows containing a certain number of observations. \n", "#You can indicate this with the thresh argument:\n", "cleaned01 = sell_data.dropna(thresh=2)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned01.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#Method 2: Filling In Missing Data\n", "cleaned02 = sell_data.fillna(0)\n", "cleaned02.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned03 = sell_data\n", "cleaned03.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned03['age']=cleaned03['age'].fillna(cleaned03.age.mean())" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned03.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Removing Duplicates" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "sell_data.duplicated()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned04 = sell_data.drop_duplicates()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned04 = cleaned04.fillna(0)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "cleaned04.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }