본문 바로가기
2/[ Python ]

Remove Negative Values in Numeric columns in DataFrame

by Kieran_Han 2022. 6. 28.
df = data[data.select_dtypes(include = [np.number]).ge(0).all(1)]
df

 

When the DataFrame consists of Obejct, float, and DateTime, we can use "select_dtypes" to handle only numeric columns.