From 7a8dadbe3b642fde2515711e4b390152923291f8 Mon Sep 17 00:00:00 2001 From: "wagner.agnieszka" Date: Sun, 3 Jun 2018 20:24:02 +0200 Subject: [PATCH] passed --- labs06/task02.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/labs06/task02.py b/labs06/task02.py index 8dffbd4..9eb863f 100755 --- a/labs06/task02.py +++ b/labs06/task02.py @@ -13,7 +13,8 @@ def most_common_room_number(dane): def cheapest_flats(dane, n): - + p = dane.sort_values(['Expected'], ascending=[0]) + p.head(7) def find_borough(desc): dzielnice = ['Stare Miasto', @@ -34,13 +35,18 @@ def write_plot(dane, filename): pass def mean_price(dane, room_number): - pass + p1 = dane[dane['Rooms'] == 2] + p2 = p1['Expected'] + p2.mean() def find_13(dane): - pass + p1 = dane[dane['Floor'] == 13] + p1.Location.unique() def find_best_flats(dane): - pass + p_index = dane['Location'].str.contains('Winogrady') + p = dane[p_index] + p[(p['Rooms'] == 3) & (p['Floor'] == 1)] def main(): dane = wczytaj_dane()