Question: The csv file AAPL tabulates the historical data for Apple stock prices for one year. Write a program that reads the content of this file

  1. The csv file AAPL tabulates the historical data for Apple stock prices for one year. Write a program that reads the content of this file line-by-line. For each date, it checks if the closing price is higher than the opening price. If it does, it writes the date, the closing price, the opening price, and the difference between the closing and the opening prices in another csv file with a title line. in python

  2.  The csv file AAPL tabulates the historical data for Apple stock

AAPL Date Open High Low Close Adj Close Volume 12/16/2019 69.25 70.197502 69.245003 69.964996 68.802635 128186000 12/17/2019 69.892502 70.442497 69.699997 70.102501 68.937851 114158400 12/18/2019 69.949997 70.474998 69.779999 69.934998 68.773132 116028400 12/19/2019 69.875 70.294998 69.737503 70.004997 68.841965 98369200 12/20/2019 70.557503 70.662498 69.639999 69.860001 68.699387 275978000 12/23/2019 70.1325 71.0625 70.092499 71 69.820442 98572000 12/24/2019 71.172501 71.222504 70.730003 71.067497 69.886818 48478800 12/26/2019 71.205002 72.495003 71.175003 72.477501 71.273392 93121200 12/27/2019 72.779999 73.4925 72.029999 72.449997 71.246353 146266000 12/30/2019 72.364998 73.172501 71.305 72.879997 71.669212 144114400 12/31/2019 72.482498 73.419998 72.379997 73.412498 72.192863 100805600 1/2/2020 74.059998 75.150002 73.797501 75.087502 73.840042 135480400 1/3/2020 74.287498 75.144997 74.125 74.357498 73.122154 146322800 1/6/2020 73.447502 74.989998 73.1875 74.949997 73.704819 118387200 1/7/2020 74.959999 75.224998 74.370003 74.597504 73.358185 108872000 1/8/2020 74.290001 76.110001 74.290001 75.797501 74.538239 132079200 1/9/2020 76.809998 77.607498 76.550003 77.407501 76.121498 170108400 1/10/2020 77.650002 78.167503 77.0625 77.582497 76.293579 140644800 1/13/2020 77.910004 79.267502 77.787498 79.239998 77.923538 121532000 1/14/2020 79.175003 79.392502 78.042503 78.169998 76.871323 161954400 1/15/2020 77.962502 78.875 77.387497 77.834999 76.541885 121923600 1/16/2020 78.397499 78.925003 78.022499 78.809998 77.500694 108829200 1/17/2020 79.067497 79.684998 78.75 79.682503 78.358696 137816400 1/21/2020 79.297501 79.754997 79 79.142502 77.827667 110843200 1/22/2020 79.644997 79.997498 79.327499 79.425003 78.105476 101832400 1/23/2020 79.480003 79.889999 78.912498 79.807503 78.481621 104472000 1/24/2020 80.0625 80.832497 79.379997 79.577499 78.25544 146537600

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!