Answers for "pd drop certain rwos on value"

8

python: remove specific values in a dataframe

df.drop(df.index[df['myvar'] == 'specific_name'], inplace = True)
Posted by: Guest on June-22-2020
1

pandas dataframe remove rows by column value

df = df[df.line_race != 0]
Posted by: Guest on April-07-2020
0

drop rows with certain values pandas

#to drop rows based on certain condition in a column
import pandas as pd

df = df[df['column']!=1]
Posted by: Guest on January-04-2022

Python Answers by Framework

Browse Popular Code Answers by Language