根据其他列删除重复数据框

时间:2020-03-10 01:37:01

标签: dataframe filter

我有以下数据框df:

A     B     procedure
aa  pass    2
aa  pass    1
aa  fail    1
b   pass    2
b   pass    1

我想要下表df1

A     B     procedure
aa  pass    2
aa  pass    1
b   pass    2
b   pass    1

基本上,如果对于给定的过程,如果再次运行,并且这次是通过,则我想保留通过并消除失败。我不确定如何根据多个条件删除行

1 个答案:

答案 0 :(得分:0)

查看所需结果,您只需为列/** * An *action* is a plain object that represents an intention to change the * state. Actions are the only way to get data into the store. Any data, * whether from UI events, network callbacks, or other sources such as * WebSockets needs to eventually be dispatched as actions. * * Actions must have a `type` field that indicates the type of action being * performed. Types can be defined as constants and imported from another * module. It's better to use strings for `type` than Symbols because strings * are serializable. * * Other than `type`, the structure of an action object is really up to you. * If you're interested, check out Flux Standard Action for recommendations on * how actions should be constructed. * * @template T the type of the action's `type` tag. */ export interface Action<T = any> { type: T } 仅选择pass

B