def lowEnergy():
tids = []
# get songs by recommendation
results = sp.recommendations(seed_artists = [artist['id']])
#retrieve uris for songs
for track in results['tracks']:
tids.append(track['uri'])
#get audio_features
features = sp.audio_features(tids)
#pick energies
energy = [x['energy'] for x in features]
#here I filter out low energy values
low_energy = [x for x in energy if x < 0.5]
#get track names
track_names = [sp.track(uri)['name'] for uri in tids]
Now I would like to filter out track names by energy values below 0.5, like so:
track name1 - 0.49
track name2 - 0.34
and so on.
but I'm struggling here...how do I achieve this? thanks