From ad880b3674605907d6f8d8b8544e5a7c3a1daa19 Mon Sep 17 00:00:00 2001 From: s45148 Date: Sat, 16 Dec 2017 13:29:56 +0100 Subject: [PATCH] labs04 z1 --- labs06/task00.py | 1 + labs06/task02.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 labs06/task00.py diff --git a/labs06/task00.py b/labs06/task00.py new file mode 100644 index 0000000..386860a --- /dev/null +++ b/labs06/task00.py @@ -0,0 +1 @@ +import pandas as pd \ No newline at end of file diff --git a/labs06/task02.py b/labs06/task02.py index 9d96016..740e1e6 100755 --- a/labs06/task02.py +++ b/labs06/task02.py @@ -1,12 +1,21 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +import pandas as pd def wczytaj_dane(): - pass + my_data = pd.read_csv('mieszkania.csv', + encoding='utf-8', + index_col='Id') + return my_data + #print(my_data) def most_common_room_number(dane): - pass - + room_num = dane['Rooms'] + room_num_rank = room_num.value_counts() + room_num_list = list(room_num_rank) + return type(room_num_rank) + #return ( room_num_list[room_num_list.index(max(room_num_list))] ) + #pass def cheapest_flats(dane, n): pass @@ -45,7 +54,7 @@ def main(): .format(most_common_room_number(dane))) print("{} to najłądniejsza dzielnica w Poznaniu." - .format(find_borough("Grunwald i Jeżyce")))) + .format(find_borough("Grunwald i Jeżyce"))) print("Średnia cena mieszkania 3-pokojowego, to: {}" .format(mean_price(dane, 3)))