Python pandas 数据框 按列值 筛选数据(单值筛选,按照列表多值筛选)

**

目标1:从d0数据框中,筛选出rs列中包含 '2_161686082’中值的数据框

**
Python pandas 数据框 按列值 筛选数据(单值筛选,按照列表多值筛选)_第1张图片

d1 = d0.loc[d0['rs']=='2_161686082']
d1

Python pandas 数据框 按列值 筛选数据(单值筛选,按照列表多值筛选)_第2张图片
**

目标2:从d0数据框中,筛选出rs列中包含

**

l1=['2_161686082','ALGA0072703','ASGA0022902','ASGA0040345','ASGA0098828','M1GA0006480','MARC0080181','WU_10.2_1_311973532','WU_10.2_1_312813451','WU_10.2_10_735574','WU_10.2_2_15352042','WU_10.2_4_134993242','WU_10.2_4_7185799','WU_10.2_7_134736770','WU_10.2_17_47077245']

**

中所有值的数据框

**

d2 = d0.loc[d0['rs'].isin(['2_161686082','ALGA0072703','ASGA0022902','ASGA0040345','ASGA0098828','M1GA0006480','MARC0080181','WU_10.2_1_311973532','WU_10.2_1_312813451','WU_10.2_10_735574','WU_10.2_2_15352042','WU_10.2_4_134993242','WU_10.2_4_7185799','WU_10.2_7_134736770','WU_10.2_17_47077245'])]
d2

Python pandas 数据框 按列值 筛选数据(单值筛选,按照列表多值筛选)_第3张图片

你可能感兴趣的:(PYTHON,大数据操作,数据筛选)