PySpark Drop Only True
PySpark Drop Only True
PySpark Drop Only True
- PySpark에서 True, False, Null로 이루어진 열이 있을 수 있음
- 이 열에서 값이 오직
True
인 행만 drop하고 싶은 경우, 다음과 같이 구현하면 됨
import pyspark.sql.functions as F
df = df.filter((F.col("c1").isNull()) | (F.col("c1") == False))
# 아래와 같이 괄호를 생략하면 안 됨
df = df.filter(F.col("c1").isNull() | F.col("c1") == False)