Analyzing friendships with statistics
Published on October 28, 2026 statistics data-analysis pythonUsing jaccard similarity to check the probability of speaking in the same 5 minute interval as another person, you can infer how close of a relationship they share.
I analyzed a few years worth of discord messages to do just this.
Tools used:
- DiscordChatExporter
- Python (numpy, pandas, networkx, matplotlib puplot and animation)
- john doe
- my own library that implements dockers random name generation
- used to anonymize names
How to use
- install discordchatexporter
- export messages to
messages.csv - install dependencies
- run the
test.ipynbnotebook
How it works
- split all messages in 5 minute intervals
- use jaccard similarity (intersection/union) to determine if you usually speak in the same interval
- if you’re repeatedly seen in the same interval as someone else, you’re moved closer to him in the graph
- a pattern naturally forms, which shows how close people are to eachother