首页 > 解决方案 > “不再支持将列表喜欢传递给带有任何缺失标签的 .loc 或 []。缺少以下标签:Index([5], dtype='object')

问题描述

我正在尝试执行前 5 个预算,但出现错误。如何解决这个问题?

def best_worst(n, by, ascending = False, min_bud = 0, min_votes = 0):


df2 = movie_best.loc[(movie_best.Budget>= min_bud) & (movie_best.Votes >= min_votes), 
                  [n, by]].sort_values(by = by, ascending = ascending).head(n).copy()

return HTML(df2.to_html(escape=False))

 best_worst(5,"Budget_MUSD")

标签: pythonjupyter-notebook

解决方案


推荐阅读