Python 使用loc功能删除

Python 使用loc功能删除,python,pandas,Python,Pandas,如何使用pandas中的loc功能删除 我有一个有索引的数据框。如果我选择索引如下的行: testbed.experiment_log.loc[15174159612] 我得到了那个数据帧的序列 type anomaly event stress_disk_nodes nodes {10.136.45.96, 10.136.45.95} date_start

如何使用pandas中的loc功能删除

我有一个有索引的数据框。如果我选择索引如下的行:

testbed.experiment_log.loc[15174159612]
我得到了那个数据帧的序列

type                                   anomaly
event                        stress_disk_nodes
nodes             {10.136.45.96, 10.136.45.95}
date_start                          1517415961
date_end                            1517415981
aditional_info                    Stressors: 6
Name: 1517415961258, dtype: object

如何删除此行?请注意,我不想使用索引中的位置。其他人已经指出了一些我已经看到的使用df.index的方法,但我想使用索引的值(与df.loc相同)

实际上,您不必使用loc,只需使用该数据帧中的索引值。在本例中:

testbed.experiment_log.drop(1516874441881)

事实上,关于如何根据各种条件删除,已经有了非常好的概述: