Advertisement
AAMzz

Untitled

May 14th, 2024
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.50 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3.  
  4. data = pd.Series([
  5.     10.7 ,  9.58,  7.74,  8.3 , 11.82,  9.74, 10.18,  8.43,  8.71,
  6.      6.84,  9.26, 11.61, 11.08,  8.94,  8.44, 10.41,  9.36, 10.85,
  7.     10.41,  8.37,  8.99, 10.17,  7.78, 10.79, 10.61, 10.87,  7.43,
  8.      8.44,  9.44,  8.26,  7.98, 11.27, 11.61,  9.84, 12.47,  7.8 ,
  9.     10.54,  8.99,  7.33,  8.55,  8.06, 10.62, 10.41,  9.29,  9.98,
  10.      9.46,  9.99,  8.62, 11.34, 11.21, 15.19, 20.85, 19.15, 19.01,
  11.     15.24, 16.66, 17.62, 18.22, 17.2 , 15.76, 16.89, 15.22, 18.7 ,
  12.     14.84, 14.88, 19.41, 18.54, 17.85, 18.31, 13.68, 18.46, 13.99,
  13.     16.38, 16.88, 17.82, 15.17, 15.16, 18.15, 15.08, 15.91, 16.82,
  14.     16.85, 18.04, 17.51, 18.44, 15.33, 16.07, 17.22, 15.9 , 18.03,
  15.     17.26, 17.6 , 16.77, 17.45, 13.73, 14.95, 15.57, 19.19, 14.39,
  16.     15.76])
  17.  
  18. state = np.random.RandomState(12345)
  19.  
  20. # сохраните значения 99%-квантилей в переменной values
  21. values = []
  22. for i in range(1000):
  23.     subsample = data.sample(frac=1, replace=True, random_state=state)
  24.     # < напишите код здесь >
  25.     values.append(subsample)
  26.  
  27. # < напишите код здесь >
  28. values = pd.Series(values)
  29.  
  30. lower = values.quantile(.05)# < напишите код здесь >
  31. upper = values.quantile(.95)# < напишите код здесь >
  32.  
  33. print(lower)
  34. print(upper)
  35.  
  36. """
  37. Traceback (most recent call last):
  38.  File "main.py", line 30, in <module>
  39.  
  40. ValueError: Can only compare identically-labeled Series objects
  41. """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement