ctf-resources/thm/aoc23/day02/2_ip_address.py

11 lines
316 B
Python
Raw Normal View History

2024-07-03 21:06:15 +02:00
#!/usr/bin/env python3
import pandas as pd
df = pd.read_csv('network_traffic.csv')
df.head(5)
# We need to perform a groupby with Pandas size function the "Source" and "Destination" columns.
# For example: dataframe.groupby(['ColumnName']).size()
print(df.groupby(['Source']).size().sort_values(ascending=False))