15 lines
486 B
Python
15 lines
486 B
Python
import pandas as pd
|
|
from statistics import median
|
|
|
|
# Read dataset and fill missing rows with zeroes
|
|
dataset = pd.read_csv('csv/global_last10years.csv', index_col=0).fillna(0)
|
|
|
|
# List of unique source IPs per hour (daily avg)
|
|
ts_uIPs = dataset.iloc[:,2]
|
|
|
|
# List of unique destination IPs per hour (daily avg)
|
|
ts_uIPd = dataset.iloc[:,3]
|
|
|
|
ratio_uIPd_uIPs = median(ts_uIPd) / median(ts_uIPs)
|
|
print('Ratio between median IP destinations and median IP sources: ', round(ratio_uIPd_uIPs, 2))
|