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()