teceai

Untitled

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