TypeError: concat() 得到一个意外的关键字参数'join_axes'


早上好

我是编程和使用python的新手。我想用这个

Genre = movie_ratings_selected_df['Genres']
Genre = Genre.str.get_dummies().add_prefix('Genres_')
movie_ratings_genres_df = pd.concat(
[movie_ratings_selected_df.drop(
['Genres'],
axis=1
),
>     Genre],
>    axis=1,
>    join_axes=[movie_ratings_selected_df.index]
>)
>movie_ratings_genres_df.head()

我得到这个错误,它现在在我上面…

TypeError: concat() got an unexpected keyword argument 'join_axes'

谢谢你的帮助。

问题是连接轴不是函数pd.concat()的有效参数,试着查看这个函数的文档https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.concat.html