In [4]:
import pandas as pd
In [2]:
import pickle
with open('train_track_info.pickle','r') as f:
track_info = pickle.load(f)
print "Number of songs in my genre mapping dataset: " + str(len(track_info))
In [46]:
tagtraum = pd.read_csv('msd_tagtraum_cd1.cls',sep='\t',comment='#',names=['id','genre1','genre2'],na_values='',dtype=str)
print "Number of songs in tagtraum dataset: " + str(len(tagtraum))
In [56]:
num_rap = np.sum(tagtraum.genre1 == 'Rap') + np.sum(tagtraum.genre2 == 'Rap')
print "Number of rap songs: %d Percentage rap: %.2f" % (num_rap, 100*float(num_rap)/len(tagtraum))
In [49]:
magd = pd.read_csv('msd_tagtraum_cd1.cls',sep='\t',comment='#',names=['id','genre'],na_values='',dtype=str)
In [51]:
print "Number of songs in magd dataset: " + str(len(magd))
In [54]:
num_rap = np.sum(magd.genre == 'Rap')
print "Number of rap songs: %d Percentage rap: %.2f" % (num_rap, 100*float(num_rap)/len(magd))
In [ ]: