Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Compute Stock Returns and Volatility | Financial Data Analysis with Python
Practice
Projects
Quizzes & Challenges
Quizzen
Challenges
/
Python for Investors
Sectie 1. Hoofdstuk 3
single

single

bookChallenge: Compute Stock Returns and Volatility

Veeg om het menu te tonen

Taak

Swipe to start coding

You are given a DataFrame containing daily closing prices for three stocks over ten days. Your task is to analyze the data as follows:

  • Calculate the daily returns for each stock as the percentage change from the previous day's closing price;
  • Compute the average daily return for each stock;
  • Compute the volatility (standard deviation) of the daily returns for each stock;
  • Print a summary table (as a DataFrame) with one row for each stock and columns for average return and volatility (both as decimals, not percentages).

Make sure your summary table is clear and easy to read. Use only the libraries provided above.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 3
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt