Created
November 8, 2022 19:00
-
-
Save diogodanielsoaresferreira/10721f8f24ebcb828f947f7c1d594d5d to your computer and use it in GitHub Desktop.
Calculate most common combinations using Pandas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
pd.read_csv('Dataset-Unicauca-Version2-87Atts.csv', header = 0) | |
.groupby(['Source.IP', 'Source.Port', 'Destination.IP', 'Destination.Port']) | |
.size() | |
.sort_values(ascending=False)[:20] | |
.to_csv('processed_data_python.csv') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment