Filter data.frame rows by a logical condition

前端 未结 9 1408
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-21 05:43

I want to filter rows from a data.frame based on a logical condition. Let\'s suppose that I have data frame like

   expr_value     cell_type
1           


        
9条回答
  •  我寻月下人不归
    2020-11-21 06:04

    This worked like magic for me.

    celltype_hesc_bool = expr['cell_type'] == 'hesc'

    expr_celltype_hesc = expr[celltype_hesc]

    Check this blog post

提交回复
热议问题