ComeçarComece de graça

Simulating sales under new market conditions

The company's financial analyst is predicting that next quarter, the worth of each sale will increase by 20% and the volatility, or standard deviation, of each sale's worth will increase by 30%. To see what Amir's sales might look like next quarter under these new market conditions, you'll simulate new sales amounts using the normal distribution and store these in the new_sales DataFrame, which has already been created for you.

In addition, norm from scipy.stats, pandas as pd, and matplotlib.pyplot as plt are loaded.

Este exercício faz parte do curso

Introduction to Statistics in Python

Ver curso

Instruções do exercício

  • Currently, Amir's average sale amount is $5000. Calculate what his new average amount will be if it increases by 20% and store this in new_mean.
  • Amir's current standard deviation is $2000. Calculate what his new standard deviation will be if it increases by 30% and store this in new_sd.
  • Create a variable called new_sales, which contains 36 simulated amounts from a normal distribution with a mean of new_mean and a standard deviation of new_sd.
  • Plot the distribution of the new_sales amounts using a histogram and show the plot.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Calculate new average amount
new_mean = ____

# Calculate new standard deviation
new_sd = ____

# Simulate 36 new sales
new_sales = ____

# Create histogram and show
plt.____
____
Editar e executar o código