1
我有一個熊貓數據幀,看起來像這樣:引用到iterrows下一個索引()
top heading page_no
0 000000 Intro 0
1 100164 Summary 1
2 100451 Experience 1
3 200131 Awards 2
4 200287 Skills 2
5 300147 Education 3
6 300273 Awards 3
7 300329 Interests 3
8 300434 Certifications 3
9 401135 End 4
我用它使用這個數據幀從其他數據框獲得內容的過濾器。它需要的頂部之間的一切過濾即從000000到100164,並以此類推,直到300434到401135.
for index,row in df_heads.iterrows():
begin = int(row['top'])
end = ???
filter_result = result['data'][(result.top < end) & (result.top > begin)]
print(row['heading'])
print(filter_result)
sections[row['heading']] = filter_result
end = begin
我應該末與使我們得到了過濾器的內容,以正確的方式進行初始化?