Skip to content

Instantly share code, notes, and snippets.

View kartikeyaSh's full-sized avatar

Kartikeya Sharma kartikeyaSh

View GitHub Profile
import numpy as np
from pprint import pprint
from collections import defaultdict
m = np.matrix(
[
[1, 2, 0],
[3, 0, 5],
[0, 7, 0],
[4, 0, 0],
def get_artist_cluster_id_using_artist_mbids(connection, artist_credit_mbids):
"""Returns the artist_credit_cluster_id that corresponds
to the given artist MBIDs
"""
query = text("""SELECT artist_credit_cluster_id
FROM artist_credit_redirect_json
WHERE artist_mbids_json::text = :artist_credit_mbids
""")

recording_json

id data data_sha256 meta_sha256
1 {"artist":"Jay\u2010Z & Beyonc\u00e9","recording_mbid":"5465ca86-3881-4349-81b2-6efbd3a59451","title":"'03 Bonnie & Clyde"} 9db1d48646b94fd517e0906f6f0540a02f520cd99d6ab5cb25a4475e2417b040 93840a6e5c3b29f6192625687e40a377abb7f136ef5bc0a14705259d07c4acb4
2 {"artist":"Lil\u2019 Kim","recording_mbid":"6ba092ae-aaf7-4154-b987-9eb9d05f8616","title":"Don't Mess With Me"} 782606d8332acfe42349b6dff05a8675a9f69deb511d9daa9b8100b4bf295