teceai

Untitled

Feb 9th, 2021
594
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pandas as pd
  2.  
  3. reviews_values = [
  4.     [68,18], [81,19], [81,22], [15,75], [75,15], [17,72],
  5.     [24,75], [21,91], [76, 6], [12,74], [18,83], [20,62],
  6.     [21,82], [21,79], [84,15], [73,16], [88,25], [78,23],
  7.     [32, 81], [77, 35]]
  8. reviews = pd.DataFrame(reviews_values, columns=['Цена', 'Качество'])
  9.  
  10. visitors_count = len(reviews['Цена'].values)
  11. visitor4 = reviews.loc[4].values
  12.  
  13. clients_1 = []
  14. clients_2 = []
  15. for client in list(reviews.values):
  16.     if reviews[reviews['Цена'] > 40] and reviews[reviews['Цена'] < 60]:
  17.         clients_1.append(client)
  18.     else:
  19.         clients_2.append(client)
  20.  
  21. print("Оценки пришедших с первого агрегатора:", clients_1)
  22. print("Оценки пришедших со второго агрегатора:", clients_2)
RAW Paste Data