Challenge: Compute Stock Returns and Volatility
Tarefa
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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 3
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 4.76
Challenge: Compute Stock Returns and Volatility
Deslize para mostrar o menu
Tarefa
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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 3
single