从iloc获取数据帧行的索引

时间:2017-07-12 02:02:36

标签: python pandas

我已经过滤了一个数据帧以获得某些行以匹配条件。现在生成的dataframetest_acion_data)包含这样的索引

Int64Index([ 115,  116,  186,  187,  199,  302,  303,  306,  314,  325 ...
            5745, 5746, 5747, 5748, 5749, 5750, 5751, 5752, 5753, 5754],dtype='int64', length=200)

我想访问此test_action_data数据帧的每一行,并将一列的值与同一数据帧的下一行的相应列进行比较。所以我正在使用test_action_data.iloc[j]

for j in range(10):
     if(some condition):
         test_action_data.iloc[j].dropna(axis=0)

我没有收到任何错误,但行没有被删除。请帮帮我

0 个答案:

没有答案
相关问题