diff --git a/ex2/rep-13.py b/ex2/rep-13.py new file mode 100644 index 0000000..918f834 --- /dev/null +++ b/ex2/rep-13.py @@ -0,0 +1,29 @@ +import pandas as pd + +df = pd.read_csv(r'./data/Ex2aggFlows_team13.csv') + +dataLength = len(df) + +mean_packet_count = df['packetTotalCount'].mean() +mean_unique_source = df['distinct(sourceIPAddress)'].mean() +mean_num_bytes = df['ipTotalLength'].mean() + +print("Mean `packetTotalCount`: {}".format(round(mean_packet_count, 3))) +print("Mean `distinct(sourceIPAddress)`: {}".format(round(mean_unique_source, 3))) +print("Mean `ipTotalLength`: {}".format(round(mean_num_bytes, 3))) + +median_packet_count = df['packetTotalCount'].median() +median_unique_source = df['distinct(sourceIPAddress)'].median() +median_num_bytes = df['ipTotalLength'].median() + +print("Median `packetTotalCount`: {}".format(round(median_packet_count, 3))) +print("Median `distinct(sourceIPAddress)`: {}".format(round(median_unique_source, 3))) +print("Median `ipTotalLength`: {}".format(round(median_num_bytes, 3))) + +std_packet_count = df['packetTotalCount'].std() +std_unique_source = df['distinct(sourceIPAddress)'].std() +std_num_bytes = df['ipTotalLength'].std() + +print("Std `packetTotalCount`: {}".format(round(std_packet_count, 3))) +print("Std `distinct(sourceIPAddress)`: {}".format(round(std_unique_source, 3))) +print("Std `ipTotalLength`: {}".format(round(std_num_bytes, 3)))