def get_artist_data(df, spotify_id): index = df.index[df['SPOTIFY_ARTIST_ID'] == spotify_id].tolist()[0] artist_attribute_genre = df['C_GENRES'].iloc[index] artist_attribute_name = df['C_ARTIST_NAME'].iloc[index] artist_attribute_country = df['C_FAN_COUNTRY_CODE'].iloc[index] # artist_attribute_popularity = df['C_POPULARITY'].iloc[index] artist_attribute_band_type = df['C_BAND'].iloc[index] artist_attribute_pronoun = df['C_PRONOUN'].iloc[index] artist_attribute_gender = df['C_GENDER'].iloc[index] artist_description = {'name': artist_attribute_name, 'genres': artist_attribute_genre[0:75], 'streaming_countries': artist_attribute_country, 'is artist band': artist_attribute_band_type, 'pronoun': artist_attribute_pronoun, 'gender': artist_attribute_gender, # 'Popularity': artist_attribute_popularity } return artist_description, index