问题出在union()函数的第一个传参类型不正确,它要求两个set类型,合并成一个set。而根据出错的提示看,分割出的变量i, 似乎是一个浮点数。所以,可以尝试以下写法:
union()
set
i
genres = set().union(set({i}),genres)