15 lines
553 B
Python
15 lines
553 B
Python
import pandas as pd
|
|
|
|
df = pd.read_csv(r'data/Ex2flows_team13.csv')
|
|
|
|
dataLength = len(df)
|
|
|
|
singleDestinationFilter = df['distinct(destinationIPAddress)'] == 1
|
|
moreThan10DestinationsFilter = df['distinct(destinationIPAddress)'] > 10
|
|
|
|
percentageOfSingleDst = len(df[singleDestinationFilter]) / dataLength * 100
|
|
percentageOfMoreThan10Dst = len(df[moreThan10DestinationsFilter]) / dataLength * 100
|
|
|
|
print("Single Destination: {} %".format(round(percentageOfSingleDst, 3)))
|
|
print("More than 10 destinations: {} %".format(round(percentageOfMoreThan10Dst, 3)))
|