15 lines
429 B
Python
15 lines
429 B
Python
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}")
|