Skip to content

Instantly share code, notes, and snippets.

@jgoodie
Created May 27, 2024 03:26
Show Gist options
  • Save jgoodie/5db18b65f3d68b0e0f04737bbf5c29f1 to your computer and use it in GitHub Desktop.
Save jgoodie/5db18b65f3d68b0e0f04737bbf5c29f1 to your computer and use it in GitHub Desktop.
df = pd.read_csv("data/RT_IOT2022.csv")
print(df.shape)
print("===========================================")
print(df.head())
print(df[['service', 'proto', 'Attack_type']])
labels = dict(Counter(df.Attack_type).most_common())
print(labels)
plt.figure(figsize=(8,6))
plt.title("Attack Type distribution")
plt.bar(x=labels.keys(), height=labels.values())
plt.xticks(rotation=45, ha='right')
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment