Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- data = pd.Series([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
- #mean_value = # write your code here: find the mean value in the data set
- #spacing_all = # write your code here: for each element in the data set, find its distance to the mean
- #spacing_all_mean = # write your code here: calculate the average distance
- mean_value = data.mean()
- print(mean_value)
- # for each element in the data set, find its distance to the mean
- spacing_all = data - mean_value
- print(spacing_all)
- # calculate the average distance
- spacing_all_mean = spacing_all.mean()
- print(spacing_all_mean)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement