본문 바로가기

Programming/Python

[Pandas] DataFrame에서 특정 리스트에 해당하는 열 추출하기

isin() 사용하기

# pandas version : 1.3.3

mask = df["No"].isin([1,2,3])
df[mask]