Add script for rep-13
This commit is contained in:
parent
4d695a9755
commit
2a79055637
29
ex2/rep-13.py
Normal file
29
ex2/rep-13.py
Normal file
@ -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)))
|
||||||
Loading…
x
Reference in New Issue
Block a user