1. 筛选出数据的指定几行数据
adata.obs[1:10]
2. 筛选出数据某列为某值的所有数据记录
adata.obs[adata.obs['phenoid'] == 'CD56+_NK']
3. 多条件匹配时
(注意不要写and, 写成&)
data_many=df[(df['列名1']== ‘列值1')&(df['列名2']==‘列值2')]
adata.obs[(adata.obs['phenoid'] == 'CD56+_NK') & (adata.obs['n_genes_by_counts'] == 542)]
4. 单列多值匹配时
(注意不要写or, 写成|)
adata.obs[(adata.obs['Label'] == 'Treg') | (adata.obs['Label'] == 'memory CD4 T')]