Question: Load the AMZN.csv data as a Pandas DataFrame. The file contains the stock price values for Amazon over the last year. Numbers 2-5 needs be

Load the AMZN.csv data as a Pandas DataFrame. The file contains the stock price values for Amazon over the last year. Numbers 2-5 needs be a single line of code.

1. Extract the year from the Date column and store it as a separate column. The value of the year should be an integer not a string. Cast it if you need to.

2. Use function agg() to find the minimum of all closing prices (the data in Close)

3. Use function agg() to find the maximum of all closing prices

4. Use function agg() to find the average/mean of all closing prices

5. Use function agg() and something else to find the average closing price only for the year 2021.

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 Mathematics Questions!