{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Assignment. Exploratory Data Analysis\n", "\n", "\n", "\n", "\n", "\n", "In part 1 of this assignment, we will focus on...

1 answer below »
I have trouble on my python assignment


{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Assignment. Exploratory Data Analysis\n", "\n", "\n", "\n", "\n", "\n", "In part 1 of this assignment, we will focus on exploratory data analysis of stock prices. Keep in mind, this assignment is just meant to practice your visualization and pandas skills, it is not meant to be a robust financial analysis or be taken as financial advice.\n", "____\n", "** NOTE: This project is challenging and you have to look things up on your own to try to solve the tasks issued. **\n", "____\n", "We'll focus on tech stocks and see how they progressed throughout the pandemic from the beginning of 2020 all the way to the end of Dec. 2020. You may look at other sectors as well in the end of this notebook, such as Airline companies and retail industry." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Part 1\n", "\n", "\n", "## Get the Data\n", "\n", "In this section we will learn how to use pandas to directly read data from Yahoo finance using pandas!\n", "\n", "First we need to start with the proper imports, which we've already laid out for you here.\n", "\n", "*Note: [You'll need to install pandas-datareader for this to work!](https://github.com/pydata/pandas-datareader) Pandas datareader allows you to [read stock information directly from the internet](http://pandas.pydata.org/pandas-docs/stable/remote_data.html) Use these links for install guidance (**pip install pandas-datareader**).*\n", "\n", "### The Imports\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#you need to install pandas datareader first. If you are using Canopy, you may comment out the first line. If you are using Anaconda, you may comment out the second line.\n", "#!pip install pandas-datareader\n", "#conda install -c anaconda pandas-datareader \n", "#!pip install --upgrade pandas\n", "import pandas as pd\n", "import numpy as np\n", "pd.core.common.is_list_like = pd.api.types.is_list_like\n", "from pandas_datareader import data, wb\n", "\n", "import datetime\n", "%matplotlib inline" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Data\n", "\n", "We need to get data using pandas datareader. We will get stock information for the following companies:\n", "* Amazon\n", "* Facebook\n", "* Google\n", "* Microsoft\n", "* Twitter\n", "* Apple\n", "\n", "\n", "** Figure out how to get the stock data from Jan 1st 2020 to December 31st 2020 for each of these companies. Set each company to be a separate dataframe, with the variable name for that bank being its ticker symbol. This will involve a few steps:**\n", "1. Use datetime to set start and end datetime objects.\n", "2. Figure out the ticker symbol for each company.\n", "2. Figure out how to use datareader to grab info on the stock.\n", "\n", "** Use [this documentation page](https://pandas-datareader.readthedocs.io/en/latest/) for hints and instructions (it should just be a matter of replacing certain values. Use yahoo finance as a source, for example:**\n", " \n", " # Amazon\n", " Amazon = data.DataReader(\"AMZN\", 'yahoo', start, end)\n", "\n", "You may also use yfinance library explained in Method 2.\n", "\n", "Thirdly, in case you want to use iex API, you may follow the steps here to register for an API token:https://algotrading101.com/learn/iex-api-guide/ \n", "\n", "The steps are basically:\n", "1. register an account on https://iexcloud.io/console/\n", "2. browse to the bottom, choose the \"start free plan\"\n", "3. on the left you will see API_Tokens, and then generate your api tokens\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Method 1" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "start = datetime.datetime(2020, 1, 1)\n", "end = datetime.datetime(2020, 12, 31)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Amazon\n", "Amazon = data.DataReader(\"AMZN\", 'yahoo', start, end)\n", "\n", "# Facebook\n", "Facebook = data.DataReader(\"FB\", 'yahoo', start, end)\n", "\n", "# Google\n", "Google = data.DataReader(\"GOOG\", 'yahoo', start, end)\n", "\n", "# Microsoft\n", "Microsoft = data.DataReader(\"MSFT\", 'yahoo', start, end)\n", "\n", "# Twitter\n", "Twitter = data.DataReader(\"TWTR\", 'yahoo', start, end)\n", "\n", "# Apple\n", "Apple = data.DataReader(\"AAPL\", 'yahoo', start, end)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Amazon.reset_index(inplace=True)\n", "Amazon[\"Date\"].value_counts()\n", "Amazon.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Method 2" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true }, "outputs": [], "source": [ "!pip install yfinance\n", "import yfinance as yfin\n", "yfin.pdr_override()\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "AMZN = data.get_data_yahoo(\"AMZN\", start=start, end=end)\n", "AMZN.head()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Could also do this for a Panel Object\n", "#df = data.DataReader(['AMZN', 'FB', 'GOOG', 'MSFT', 'TWTR', 'AAPL'],'yahoo', start, end)\n", "#df.head" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Add a Column_Company Name (this is filled out for you)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "Amazon[\"Company\"]='Amazon'\n", "Facebook[\"Company\"]='Facebook'\n", "Microsoft[\"Company\"]='Microsoft'\n", "Twitter[\"Company\"]='Twitter'\n", "Apple[\"Company\"]='Apple'\n", "Google[\"Company\"]='Google'" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Draw the closing prices of Amazon" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "\n", "# your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Append all the data sets - these six tables" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# your code here" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Derive the average closing price for each company"
Answered Same DayNov 07, 2021

Answer To: { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Assignment. Exploratory Data...

Sandeep Kumar answered on Nov 08 2021
112 Votes
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Assignment. Exploratory Data Analysis\n",
"\n",
"\n",
"\n",
"\n",
"\n",
"In part 1 of this assignment, we will focus on exploratory data analysis of stock prices. Keep in mind, this assignment is just meant to practice your visualization and pandas skills, it is not meant to be a robust financial analysis or be taken as financial advice.\n",
"____\n",
"** NOTE: This project is challenging and you have to look things up on your own to try to solve the tasks issued. **\n",
"____\n",
"We'll focus on tech stocks and see how they progressed throughout the pandemic from the beginning of 2020 all the way to the end of Dec. 2020. You may look at other sectors as well in the end of this notebook, such as Airline companies and retail industry."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Part 1\n",
"\n",
"\n",
"## Get the Data\n",
"\n",
"In this section we will learn how to use pandas to directly read data from Yahoo finance using pandas!\n",
"\n",
"First we need to start with the proper imports, which we've already laid out for you here.\n",
"\n",
"*Note: [You'll need to install pandas-datareader for this to work!](https://github.com/pydata/pandas-datareader) Pandas datareader allows you to [read stock information directly from the internet](http://pandas.pydata.org/pandas-docs/stable/remote_data.html) Use these links for install guidance (**pip install pandas-datareader**).*\n",
"\n",
"### The Imports\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"#you need to install pandas datareader first. If you are using Canopy, you may comment out the first line. If you are using Anaconda, you may comment out the second line.\n",
"#!pip install pandas-datareader\n",
"#conda install -c anaconda pandas-datareader \n",
"#!pip install --upgrade pandas\n",
"import pandas as pd\n",
"import numpy as np\n",
"pd.core.common.is_list_like = pd.api.types.is_list_like\n",
"from pandas_datareader import data, wb\n",
"import seaborn as sb\n",
"import datetime\n",
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Da
ta\n",
"\n",
"We need to get data using pandas datareader. We will get stock information for the following companies:\n",
"* Amazon\n",
"* Facebook\n",
"* Google\n",
"* Microsoft\n",
"* Twitter\n",
"* Apple\n",
"\n",
"\n",
"** Figure out how to get the stock data from Jan 1st 2020 to December 31st 2020 for each of these companies. Set each company to be a separate dataframe, with the variable name for that bank being its ticker symbol. This will involve a few steps:**\n",
"1. Use datetime to set start and end datetime objects.\n",
"2. Figure out the ticker symbol for each company.\n",
"2. Figure out how to use datareader to grab info on the stock.\n",
"\n",
"** Use [this documentation page](https://pandas-datareader.readthedocs.io/en/latest/) for hints and instructions (it should just be a matter of replacing certain values. Use yahoo finance as a source, for example:**\n",
" \n",
" # Amazon\n",
" Amazon = data.DataReader(\"AMZN\", 'yahoo', start, end)\n",
"\n",
"You may also use yfinance library explained in Method 2.\n",
"\n",
"Thirdly, in case you want to use iex API, you may follow the steps here to register for an API token:https://algotrading101.com/learn/iex-api-guide/ \n",
"\n",
"The steps are basically:\n",
"1. register an account on https://iexcloud.io/console/\n",
"2. browse to the bottom, choose the \"start free plan\"\n",
"3. on the left you will see API_Tokens, and then generate your api tokens\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Method 1"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"start = datetime.datetime(2020, 1, 1)\n",
"end = datetime.datetime(2020, 12, 31)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Amazon\n",
"Amazon = data.DataReader(\"AMZN\", 'yahoo', start, end)\n",
"\n",
"# Facebook\n",
"Facebook = data.DataReader(\"FB\", 'yahoo', start, end)\n",
"\n",
"# Google\n",
"Google = data.DataReader(\"GOOG\", 'yahoo', start, end)\n",
"\n",
"# Microsoft\n",
"Microsoft = data.DataReader(\"MSFT\", 'yahoo', start, end)\n",
"\n",
"# Twitter\n",
"Twitter = data.DataReader(\"TWTR\", 'yahoo', start, end)\n",
"\n",
"# Apple\n",
"Apple = data.DataReader(\"AAPL\", 'yahoo', start, end)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"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",
"
DateHighLowOpenCloseVolumeAdj Close
02019-12-311853.2600101832.2299801842.01847.83996625065001847.839966
12020-01-021898.0100101864.1500241875.01898.01001040290001898.010010
22020-01-031886.1999511864.5000001864.51874.96997137644001874.969971
32020-01-061903.6899411860.0000001860.01902.88000540618001902.880005
42020-01-071913.8900151892.0400391904.51906.85998540449001906.859985
\n",
"
"
],
"text/plain": [
" Date High Low Open Close Volume \\\n",
"0 2019-12-31 1853.260010 1832.229980 1842.0 1847.839966 2506500 \n",
"1 2020-01-02 1898.010010 1864.150024 1875.0 1898.010010 4029000 \n",
"2 2020-01-03 1886.199951 1864.500000 1864.5 1874.969971 3764400 \n",
"3 2020-01-06 1903.689941 1860.000000 1860.0 1902.880005 4061800 \n",
"4 2020-01-07 1913.890015 1892.040039 1904.5 1906.859985 4044900 \n",
"\n",
" Adj Close \n",
"0 1847.839966 \n",
"1 1898.010010 \n",
"2 1874.969971 \n",
"3 1902.880005 \n",
"4 1906.859985 "
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Amazon.reset_index(inplace=True)\n",
"Amazon[\"Date\"].value_counts()\n",
"Amazon.head()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Method 2"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Requirement already satisfied: yfinance in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (0.1.63)\n",
"Requirement already satisfied: numpy>=1.15 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from yfinance) (1.19.5)\n",
"Requirement already satisfied: multitasking>=0.0.7 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from yfinance) (0.0.9)\n",
"Requirement already satisfied: pandas>=0.24 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from yfinance) (1.2.3)\n",
"Requirement already satisfied: lxml>=4.5.1 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from yfinance) (4.6.3)\n",
"Requirement already satisfied: requests>=2.20 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from yfinance) (2.21.0)\n",
"Requirement already satisfied: pytz>=2017.3 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from pandas>=0.24->yfinance) (2021.1)\n",
"Requirement already satisfied: python-dateutil>=2.7.3 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from pandas>=0.24->yfinance) (2.8.2)\n",
"Requirement already satisfied: six>=1.5 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from python-dateutil>=2.7.3->pandas>=0.24->yfinance) (1.16.0)\n",
"Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from requests>=2.20->yfinance) (3.0.4)\n",
"Requirement already satisfied: idna<2.9,>=2.5 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from requests>=2.20->yfinance) (2.8)\n",
"Requirement already satisfied: certifi>=2017.4.17 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from requests>=2.20->yfinance) (2020.12.5)\n",
"Requirement already satisfied: urllib3<1.25,>=1.21.1 in c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\lib\\site-packages (from requests>=2.20->yfinance) (1.24.3)\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"WARNING: You are using pip version 21.0.1; however, version 21.3.1 is available.\n",
"You should consider upgrading via the 'c:\\users\\nax\\appdata\\local\\programs\\python\\python39\\python.exe -m pip install --upgrade pip' command.\n"
]
}
],
"source": [
"!pip install yfinance\n",
"import yfinance as yfin\n",
"yfin.pdr_override()\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[*********************100%***********************] 1 of 1 completed\n"
]
},
{
"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",
"
OpenHighLowCloseAdj CloseVolume
Date
2019-12-311842.01853.2600101832.2299801847.8399661847.8399662506500
2020-01-021875.01898.0100101864.1500241898.0100101898.0100104029000
2020-01-031864.51886.1999511864.5000001874.9699711874.9699713764400
2020-01-061860.01903.6899411860.0000001902.8800051902.8800054061800
2020-01-071904.51913.8900151892.0400391906.8599851906.8599854044900
\n",
"
"
],
"text/plain": [
" Open High Low Close Adj Close \\\n",
"Date \n",
"2019-12-31 1842.0 1853.260010 1832.229980 1847.839966 1847.839966 \n",
"2020-01-02 1875.0 1898.010010 1864.150024 1898.010010 1898.010010 \n",
"2020-01-03 1864.5 1886.199951 1864.500000 1874.969971 1874.969971 \n",
"2020-01-06 1860.0 1903.689941 1860.000000 1902.880005 1902.880005 \n",
"2020-01-07 1904.5 1913.890015 1892.040039 1906.859985 1906.859985 \n",
"\n",
" Volume \n",
"Date \n",
"2019-12-31 2506500 \n",
"2020-01-02 4029000 \n",
"2020-01-03 3764400 \n",
"2020-01-06 4061800 \n",
"2020-01-07 4044900 "
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"AMZN = data.get_data_yahoo(\"AMZN\", start=start, end=end)\n",
"AMZN.head()"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"# Could also do this for a Panel Object\n",
"#df = data.DataReader(['AMZN', 'FB', 'GOOG', 'MSFT', 'TWTR', 'AAPL'],'yahoo', start, end)\n",
"#df.head"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Add a Column_Company Name (this is filled out for you)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"Amazon[\"Company\"]='Amazon'\n",
"Facebook[\"Company\"]='Facebook'\n",
"Microsoft[\"Company\"]='Microsoft'\n",
"Twitter[\"Company\"]='Twitter'\n",
"Apple[\"Company\"]='Apple'\n",
"Google[\"Company\"]='Google'"
]
},
{
"cell_type": "code",
"execution_count": 9,
"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",
"
DateHighLowOpenCloseVolumeAdj CloseCompany
02019-12-311853.2600101832.2299801842.0000001847.83996625065001847.839966Amazon
12020-01-021898.0100101864.1500241875.0000001898.01001040290001898.010010Amazon
22020-01-031886.1999511864.5000001864.5000001874.96997137644001874.969971Amazon
32020-01-061903.6899411860.0000001860.0000001902.88000540618001902.880005Amazon
42020-01-071913.8900151892.0400391904.5000001906.85998540449001906.859985Amazon
...........................
2492020-12-243202.0000003169.0000003193.8999023172.68994114519003172.689941Amazon
2502020-12-283304.0000003172.6899413194.0000003283.95996156868003283.959961Amazon
2512020-12-293350.6499023281.2199713309.9399413322.00000048729003322.000000Amazon
2522020-12-303342.1000983282.4699713341.0000003285.85009832093003285.850098Amazon
2532020-12-313282.9199223241.1999513275.0000003256.92993229572003256.929932Amazon
\n",
"

254 rows × 8 columns

\n",
"
"
],
"text/plain": [
" Date High Low Open Close Volume \\\n",
"0 2019-12-31 1853.260010 1832.229980 1842.000000 1847.839966 2506500 \n",
"1 2020-01-02 1898.010010 1864.150024 1875.000000 1898.010010 4029000 \n",
"2 2020-01-03 1886.199951 1864.500000 1864.500000 1874.969971 3764400 \n",
"3 2020-01-06 1903.689941 1860.000000 1860.000000 1902.880005 4061800 \n",
"4 2020-01-07 1913.890015 1892.040039 1904.500000 1906.859985 4044900 \n",
".. ... ... ... ... ... ... \n",
"249 2020-12-24 3202.000000 3169.000000 3193.899902 3172.689941 1451900 \n",
"250 2020-12-28 3304.000000 3172.689941 3194.000000 3283.959961 5686800 \n",
"251 2020-12-29 3350.649902 3281.219971 3309.939941 3322.000000 4872900 \n",
"252 2020-12-30 3342.100098 3282.469971 3341.000000 3285.850098 3209300 \n",
"253 2020-12-31 3282.919922 3241.199951 3275.000000 3256.929932 2957200 \n",
"\n",
" Adj Close Company \n",
"0 1847.839966 Amazon \n",
"1 1898.010010 Amazon \n",
"2 1874.969971 Amazon \n",
"3 1902.880005 Amazon \n",
"4 1906.859985 Amazon \n",
".. ... ... \n",
"249 3172.689941 Amazon \n",
"250 3283.959961 Amazon \n",
"251 3322.000000 Amazon \n",
"252 3285.850098 Amazon \n",
"253 3256.929932 Amazon \n",
"\n",
"[254 rows x 8 columns]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"Amazon"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"##### Draw the closing prices of Amazon"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[]"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
"image/png":...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here