小编Jac*_*ins的帖子

AssertionError: 管理器项数必须等于块项的并集 # manager items: 6004, # tot_items: 6005

我的代码:

for column_name, column_data in summary_words.iteritems():
    if column_name != "summary" and column_name != "text" and column_name != "score" and column_name != "helpfulness":
        summary_words[column_name] = summary_words["summary"].str.count(column_name)
Run Code Online (Sandbox Code Playgroud)

其中summary_words是pandas数据框,“summary”是该数据框中的一列。当我运行代码时,我收到此错误:

AssertionError:管理器项目数必须等于块项目管理器项目的并集:6004,# tot_items:6005

有谁知道我为什么会收到此错误以及如何修复它?

great   my  This    love    you best    and will    favorite    watch   ... step    succeeds    judge   (who    strictly    things, helpfulness score   summary text
0   NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN ... NaN NaN NaN NaN NaN NaN 100.0   3   "There Is So Much Darkness Now ~ Come For The …
Run Code Online (Sandbox Code Playgroud)

python dataframe python-3.x pandas iteritems

2
推荐指数
1
解决办法
2万
查看次数

标签 统计

dataframe ×1

iteritems ×1

pandas ×1

python ×1

python-3.x ×1