CommencerCommencer gratuitement

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.

Cet exercice fait partie du cours

Introduction to Statistics in Python

Afficher le cours

Instructions

  • 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.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Calculate new average amount
new_mean = ____

# Calculate new standard deviation
new_sd = ____

# Simulate 36 new sales
new_sales = ____

# Create histogram and show
plt.____
____
Modifier et exécuter le code