Skip to content

Instantly share code, notes, and snippets.

Jeroen Boeye jeroenboeye

Block or report user

Report or block jeroenboeye

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
jeroenboeye /
Created Sep 30, 2018
Mosquito population model
import numpy as np
class Mosquito:
"""Contains the details of each Mosquito"""
def __init__(self, mother_gene_infected, father_gene_infected, sex):
self.genes = [mother_gene_infected, father_gene_infected] = sex
jeroenboeye /
Created Oct 9, 2019
Pandas UTC timestamp to local time based on timezone column
import pandas as pd
# Example dataframe
tz_df = pd.DataFrame({'timestamp': pd.to_datetime(['2019-10-08 11:20:00+00:00',
'2019-10-08 01:20:00+00:00']),
'tz': ['cet', 'est']})
# Add local_time
tz_df['local_time'] = tz_df.apply(lambda x: x.timestamp.tz_convert(, axis=1)
jeroenboeye /
Created Dec 12, 2019
Fast Numpy implementation of collaborative filtering
import numpy as np
import pandas as pd
import sklearn.metrics.pairwise
def get_recommendation_matrix(listening_history, n_similar = 20):
"""Collaborative filtering using cosine similarity"""
# Get similarity matrix, shape = (n artists, n artists)
sim_matrix = sklearn.metrics.pairwise.cosine_similarity(listening_history.T)
# add miniscule noise for sorting without duplicate values

Keybase proof

I hereby claim:

  • I am jeroenboeye on github.
  • I am jeroenboeye ( on keybase.
  • I have a public key ASAamCw_-jZZz1EENFIDcZ4Vs5rfudU85q_2MvURs_3Aewo

To claim this, I am signing this object:

You can’t perform that action at this time.