1. The starter code has been created for you. 2. Using the Yahoo Finance module, download the stock data for the stocks AMC and GME between December 1, 2021 and around the day you started this exercise (June or July 2021) in intervals of one day. You will focus only on the Close price and Volume traded. 3. Using the data downloaded from yfinance, create a new DataFrame that contains these five columns: Day, AMC Close, AMC Volume, GME Close, and GME Volume. Note the index for the DataFrame is the YYYY-MM-DD date, but you will need to make it a column. 4. Apply pd.melt() to this new DataFrame created in Step 3, such that the Day column is kept. The variable column will contain either AMC Close. AMC Volume, GME Close, and GME Volume. Rename this column to "Type". The values column will contain either the closing price or the volume traded for the respective stock on that day. 5. Create a FacetGrid of four lineplots on the stock data using the DataFrame generated in Step 4. Each lineplot will show either the closing prices or volume traded over the days within the time frame. The FacetGrid will separate the lineplots on the four different types of information: AMC Close, AMC Volume, GME Close, and GME Volume Set the suptitle to 'AMC and GME between Dec 2020 and Jun 2021. The dates will be plotted on the x axis. The y axis will be close price or Volume traded. 6. Create two Seaborn scatterplots to explore the relationships between AMC and GME stocks. The first scatterplot will show the relationship between the AMC Close prices versus the GME Close prices. Set the title of this scatterplot to 'AMC versus GME Closing Prices'. The second scatterplot will show the relationship between the AMC Volume versus the GME Volume. Set the suptitle to 'AMC and GME between Dec 2020 and Jun 2021'. Set the title of this scatterplot to 'AMC versus GME Volumes'. 7. Answer the questions below.

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter6: Managing Multiple Worksheets And Workbooks
Section: Chapter Questions
Problem 2.10CP
icon
Related questions
icon
Concept explainers
Question
I need help with this python code
1. The starter code has been created for you.
2. Using the Yahoo Finance module, download the stock data for the stocks AMC and GME between December 1, 2021 and around the day you started this
exercise (June or July 2021) in intervals of one day. You will focus only on the Close price and Volume traded.
3. Using the data downloaded from yfinance, create a new DataFrame that contains these five columns: Day, AMC Close, AMC Volume, GME Close,
and GME Volume. Note the index for the DataFrame is the YYYY-MM-DD date, but you will need to make it a column.
4. Apply pd.melt() to this new DataFrame created in Step 3, such that the Day column is kept. The variable column will contain either AMC Close,
AMC Volume, GME Close, and GME Volume. Rename this column to 'Type'. The values column will contain either the closing price or the volume
traded for the respective stock on that day.
5. Create a FacetGrid of four lineplots on the stock data using the DataFrame generated in Step 4. Each lineplot will show either the closing prices or
volume traded over the days within the time frame. The FacetGrid will separate the lineplots on the four different types of information: AMC Close, AMC
Volume, GME Close, and GME Volume Set the suptitle to 'AMC and GME between Dec 2020 and Jun 2021'. The dates will be plotted on the x axis.
The y axis will be close price or Volume traded.
6. Create two Seaborn scatterplots to explore the relationships between AMC and GME stocks. The first scatterplot will show the relationship between the
AMC Close prices versus the GME Close prices. Set the title of this scatterplot to 'AMC versus GME Closing Prices'. The second scatterplot will show
the relationship between the AMC Volume versus the GME Volume. Set the suptitle to 'AMC and GME between Dec 2020 and Jun 2021'. Set the title
of this scatterplot to 'AMC versus GME Volumes'.
7. Answer the questions below.
import pandas as pd
import yfinance as yf
import matplotlib.pyplot as plt.
import seaborn as sns
# Data organization tasks go here.
#Sample yfinance code adapt as needed
# Downloads the stock data for AAPL and TSLA between March 1, 2020 and March 30, 2020
# in intervals of one day. It will be saved into a variable named df which is a DataFrame.
df = yf.download ( tickers=['AAPL', 'TSLA' ], start='2020-03-01', \
end='2020-03-30', interval='1d' )
#FacetGrid goes here
# Scatterplot goes here
********] 2 of 2 completed
Transcribed Image Text:I need help with this python code 1. The starter code has been created for you. 2. Using the Yahoo Finance module, download the stock data for the stocks AMC and GME between December 1, 2021 and around the day you started this exercise (June or July 2021) in intervals of one day. You will focus only on the Close price and Volume traded. 3. Using the data downloaded from yfinance, create a new DataFrame that contains these five columns: Day, AMC Close, AMC Volume, GME Close, and GME Volume. Note the index for the DataFrame is the YYYY-MM-DD date, but you will need to make it a column. 4. Apply pd.melt() to this new DataFrame created in Step 3, such that the Day column is kept. The variable column will contain either AMC Close, AMC Volume, GME Close, and GME Volume. Rename this column to 'Type'. The values column will contain either the closing price or the volume traded for the respective stock on that day. 5. Create a FacetGrid of four lineplots on the stock data using the DataFrame generated in Step 4. Each lineplot will show either the closing prices or volume traded over the days within the time frame. The FacetGrid will separate the lineplots on the four different types of information: AMC Close, AMC Volume, GME Close, and GME Volume Set the suptitle to 'AMC and GME between Dec 2020 and Jun 2021'. The dates will be plotted on the x axis. The y axis will be close price or Volume traded. 6. Create two Seaborn scatterplots to explore the relationships between AMC and GME stocks. The first scatterplot will show the relationship between the AMC Close prices versus the GME Close prices. Set the title of this scatterplot to 'AMC versus GME Closing Prices'. The second scatterplot will show the relationship between the AMC Volume versus the GME Volume. Set the suptitle to 'AMC and GME between Dec 2020 and Jun 2021'. Set the title of this scatterplot to 'AMC versus GME Volumes'. 7. Answer the questions below. import pandas as pd import yfinance as yf import matplotlib.pyplot as plt. import seaborn as sns # Data organization tasks go here. #Sample yfinance code adapt as needed # Downloads the stock data for AAPL and TSLA between March 1, 2020 and March 30, 2020 # in intervals of one day. It will be saved into a variable named df which is a DataFrame. df = yf.download ( tickers=['AAPL', 'TSLA' ], start='2020-03-01', \ end='2020-03-30', interval='1d' ) #FacetGrid goes here # Scatterplot goes here ********] 2 of 2 completed
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage