Advertisement
z_californianus

Untitled

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