Get startedGet started for free

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.

This exercise is part of the course

Introduction to Statistics in Python

View Course

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Calculate new average amount
new_mean = ____

# Calculate new standard deviation
new_sd = ____

# Simulate 36 new sales
new_sales = ____

# Create histogram and show
plt.____
____
Edit and Run Code