Forum Discussion
Anonymous
4 years agoNot applicable
How to remove rows from a dataset based on condition?
I've ran the following Python script in the Query Editor but it does not change the dataset.
# 'dataset' holds the input data for this script
if dataset.iloc[5,2] == 1:
dataset.drop(4)I want the code to delete row 4 if row 5's value column is equal to 1. Any idea if there's a problem with my code? Here is a snippet of the data
# 'dataset' holds the input data for this script if dataset.iloc[5,2] == 1: dataset = dataset.drop(4)