Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Compute the mean for 'average_cost_for_two'
- costs = restaurantTable['average_cost_for_two']
- avgCosts = costs.mean()
- print("Average Cost for Two = $", avgCosts)
- # Compute percentage of values below the mean.
- belowCostMean = costs < costs.mean()
- numBelowCostMean = belowCostMean.sum()
- print("Percentage of restaurants below the mean is = ",numBelowCostMean*100/costs.count(), "%")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement