Skip to content

Instantly share code, notes, and snippets.

View ernestofgonzalez's full-sized avatar
💻
Typing...

Ernesto González ernestofgonzalez

💻
Typing...
View GitHub Profile
@ernestofgonzalez
ernestofgonzalez / link_prediction.py
Created August 3, 2022 22:36
Computing Adamic-Adar index for a specific node in a graph
@ernestofgonzalez
ernestofgonzalez / hoshen_kopelman_1d.py
Last active July 8, 2021 14:07
1D implementation of Hoshen-Kopelman cluster labelling algorithm to identify different trips in a e-scooters data frame
import random
import pandas as pd
import numpy as np
lock_state = ["locked", "unlocked", "unlocked", "unlocked", "locked", "locked", "unlocked", "unlocked"]
random_values = random.sample(range(2,20), 8)
df = pd.DataFrame(
{'state': lock_state,