Advertisement
korenizla

Untitled

Sep 12th, 2022
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. from scipy import stats as st
  2. import pandas as pd
  3.  
  4. scooters = pd.Series([15, 31, 10, 21, 21, 32, 30, 25, 21,
  5. 28, 25, 32, 38, 18, 33, 24, 26, 40, 24, 37, 20, 36, 28, 38,
  6. 24, 35, 33, 21, 29, 26, 13, 25, 34, 38, 23, 37, 31, 28, 32,
  7. 24, 25, 13, 38, 34, 48, 19, 20, 22, 38, 28, 31, 18, 21, 24,
  8. 31, 21, 28, 29, 33, 40, 26, 33, 33,  6, 27, 24, 17, 28,  7,
  9. 33, 25, 25, 29, 19, 30, 29, 22, 15, 28, 36, 25, 36, 25, 29,
  10. 33, 19, 32, 32, 28, 26, 18, 48, 15, 27, 27, 27,  0, 28, 39,
  11. 27, 25, 39, 28, 22, 33, 30, 35, 19, 20, 18, 31, 44, 20, 18,
  12. 17, 28, 17, 44, 40, 33,])
  13.  
  14. optimal_value = 30 # введите ваш код тут
  15.  
  16. alpha = .05 # введите ваш код тут
  17.  
  18.  
  19. results = st.ttest_1samp(
  20.     scooters,
  21.     optimal_value)
  22.  
  23. print('p-значение:', results.pvalue # введите ваш код тут)
  24.      
  25. if results.pvalue < alpha:
  26.     print("Отвергаем нулевую гипотезу")
  27. else:
  28.     print("Не получилось отвергнуть нулевую гипотезу")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement