Question: Python project #3- pandas, importing data, correl, matplot Start by downloading 1yr worth of stock closing prices for 3 stocks as well as the spy
Python project #3- pandas, importing data, correl, matplot
Start by downloading 1yr worth of stock closing prices for 3 stocks as well as the spy (=a total of 4 securities in 1csv or excel file). Please make sure to link the right prices to the right dates across all 4 equities in the same workbook (I use a simple vlookup for this, but feel free to use some other method). You can use Yahoo! Finance to download the data.
- Import your data using pandas (from your csv or excel file) and convert it into a df.
- Convert your dates into datetime
- Calculate the percent change for each of your stocks AND add a new column in your df showing the percent change (=adding 4 new columns)
- Plot the price of the SPY and 1 of your stocks (make sure to add a plot title and label the axes). You can import and use matplotlib for this.
- Plot the percent change of 1 of your stocks
- Create a scatter plot of the SPY and 1 other stock (with titles and labels). Make sure to use a different plot style.
- Calculate Pearsons correlation matrix for all 4 of your stocks.
PART 2
Start by downloading 1yr worth of stock prices for 3 stocks as well as the spy (=a total of 4 securities in 1 file) directly from Yahoo! Finance
- Clean up your df by del a few columns (and print () to show the change). Make sure you keep at least the closing price column
- Plot the closing prices for all of your stocks
- Please export your chart and save it down on your computer
- Please create 4 different pie or line charts in the same space
- Calculate the correlation matrix for the SPY and 1 of your other names
- Using pair plot, how would you classify each stocks relationship to the SPY? (make sure to use percent change)
- Im looking for all of you run a regression and comment on the slope and direction of the line
- Please use # and keep your answer in the ipynb file
- Using pair plot how would you classify the distribution for each of your stocks? (make sure to use percent change)
- Same as a and b for number 6
- Please show a kde in pair plot in a different cell
- Import a data series from FRED (your choice on the series)
- Plot this series using Matplot
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
