Вот функция, которая делает то, что вы хотите:
def get_columns_as_tuples(df, indices):
return [[(genre, score) for
genre in genres.split('|')] for
_, (genres, score) in df.loc[indices].iterrows()]
Возвращает список списков, потому что позволяет вам выбирать, из каких индексов получать данные.
Примеры:
# get data from rows whose index is in [0]
>>> get_columns_as_tuples(df=df, indices=[0])
[[('Action', 7.9), ('Adventure', 7.9), ('Fantasy', 7.9), ('Sci-Fi', 7.9)]]
# get data from rows whose index is in [0, 1]
>>> get_columns_as_tuples(df=df, indices=[0, 1])
[[('Action', 7.9), ('Adventure', 7.9), ('Fantasy', 7.9), ('Sci-Fi', 7.9)],
[('Action', 7.1), ('Adventure', 7.1), ('Fantasy', 7.1)]]