how do i delete rows from column 1 of a dataframe in a data frame?

use Series.between

hold_x = ~(df['X'].between(3, 10) | df['X'].between(33, 40))
hold_y = ~df['Y'].between(3, 37)


df['X'] = df['X'].where(hold_x | hold_y)

You could also use isin + range(). the difference is that in this way you can include only the left limit:

df['X'].isin(range(3, 10))

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top