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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started