Destiny or Coincidence: Based on Shannon Perry´s Experiment

Christopher Duran
5 min readJul 11, 2024

--

Kimi No na Wa (2016)

TL;DR: I developed a project to determine if you have ever crossed paths with ‘that’ person before meeting them in your life based on your mobile.

Background

I often read Xataka to stay updated on the latest technological developments and news. One thing that i readed and has intrigued me the most is Shannon Perry’s experiment — a data analyst who used location data from her and her boyfriend’s histories to determine if they had ever been close before meeting each other.

How did she do it?

She exported her and her boyfriend’s data from Google Takeout. For more information, you can visit her website. The approach is simple yet fascinating: finding all instances where two people were close within a specific distance, on the same day, and at the same time.

Now it’s my turn

Considering the approach is straightforward, I was intrigued to develop a similar tool — easy to use and accessible for anyone interested in experimenting with it

Although Shannon explains the procedures to obtain results, as a programmer, I set myself the challenge of doing it on my own, using my own logic.

Tools Used:

Google Takeout: Used Google Takeout to export my location history data. Once the export process was completed, Google provided a download link.

Replit: Opted to run the code in the cloud to avoid overloading my laptop. While other options like Google Colab exist, i found Replit worked best for me with the free account. It’s important to interact with the page regularly to prevent the session from timing out.

Firebase: Since my JSON location records file was approximately 400 MB, I uploaded it to Firebase. I chose to process the JSON files via a URL instead of downloading the file directly.

CodePen: Used CodePen to visualize the information obtained from Replit. I decided to use a heatmap to visualize most of the matches, along with options like lists and checkboxes to examine the positions of the two individuals in detail.

Let’s get to work.

  1. Go to Google Takeout and download your location history as well as that person’s:
1. This is the webpage
2. Make sure you only have location history checked.
3. Click next step
4. Make sure the export file is not split.
5. If everything went well, you should see Records.json.

2. Rename the files for each person. For this example, we will use my location history and that of a friend. If you choose to analyze the JSON files via a link and have nowhere to store them, in my case, I will opt for Firebase.

1. To obtain the link, go to the hyperlink section and copy the link.

3. Go to my Replit, you can fork my project and use your own JSON files by entering the link for each person.

1. Replit project preview
2. When running the code, you’ll see in the log the number of matches and the dates being compared.
3. Upon completion, you will have the result in the file result_01.json.
4. If you run the analyze-result-tool.py file, you will be able to see all the matches organized by dates and distances between the two persons within less than 10 meters.

4. Now that we have a smaller file with all the comparisons, let’s go to my CodePen. In the JavaScript section, you can also fork my project and specify your result_01.json link. In my case, I tried using Firebase to upload result_01.json, but for some unknown reason, CodePen couldn’t read it from Firebase. So, I uploaded the file to GitHub Gist to get the link, and everything started working fine. I implemented a heatmap to display where the most matches are located, and a list on the left to show specifically where each person was based on date and distance.

Now, something very important, the data generated by main.py finds if people coincided on the same day and place, but what about the time? The results are even more challenging to pinpoint. However, if you would like to be even more precise, i created the file ‘analyze-result-tool-by-hour.py’, where you can define the time difference between two people. That means if they coincided at the exact same moment within a range of n minutes, you’ll see something like this:

An ‘result_02.json’ file will be created if it finds results within an n-minute range.

The file result_02.json has the same structure as result_01.json for use in CodePen and will be quicker to analyze compared to the original raw files.

How works?

Disclaimer

  1. Remember that the data generated by mobile devices may not be accurate. It will depend on many factors.
  2. Depending on the amount of data you generate, the creation of the “result_01.json” file may take some time. In my case, it took approximately 6 hours.

Conclusion

I am impressed by the enormous amount of data our devices generate and, even more so, where they are heading. However, it is interesting to know certain details that would not be possible to discover otherwise.

An experiment that you could find very interesting to do with the person of your choice.

I should thank Replit for processing a large amount of data that I didn’t want to handle on my laptop, well, in the end, it’s just part of the job lol.

And finally thanks to my friend Milly for her collaboration and trust.

🪙 You can buy my projects and support me on:

--

--