Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. # Compute the mean for 'average_cost_for_two'
  2. costs = restaurantTable['average_cost_for_two']
  3. avgCosts = costs.mean()
  4. print("Average Cost for Two = $", avgCosts)
  5.  
  6. # Compute percentage of values below the mean.
  7. belowCostMean = costs < costs.mean()
  8. numBelowCostMean = belowCostMean.sum()
  9. print("Percentage of restaurants below the mean is = ",numBelowCostMean*100/costs.count(), "%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement