Added file to study the most frequent relationship into a csv triplet
This commit is contained in:
parent
e5f201f3db
commit
4bb03f86b3
14
Script/DataGathering/analysis.py
Normal file
14
Script/DataGathering/analysis.py
Normal file
@ -0,0 +1,14 @@
|
||||
import pandas as pd
|
||||
|
||||
# Load the CSV
|
||||
df = pd.read_csv("./Assets/Dataset/1-hop/reverse.csv")
|
||||
|
||||
# Extract the last part of the URL in 'relationship'
|
||||
df["relationship_short"] = df["relationship"].apply(lambda x: x.split("/")[-1])
|
||||
|
||||
# Count occurrences of each unique last part
|
||||
relationship_counts = df["relationship_short"].value_counts()
|
||||
|
||||
# Print the counts
|
||||
for rel, count in relationship_counts.items():
|
||||
print(f"{rel}: {count}")
|
||||
Loading…
x
Reference in New Issue
Block a user