Conversation

coding shouldnt be this hard, it's unreasonable. i asked ppl 'how many ppl have u had sex with', fill-in-the-blank and all i want to do is delete everything that isnt within a specific numerical range in the dataframe's column You'd think this would be pretty simple. you'd think.
84
344
Replying to
Can you share the data file so we can help you out with the exact concise code that will make this work? You’re right, this is not hard and should not be difficult. There are many straightforward approaches, depending on how messy the input data is.
1
Replying to and
I’ve been a Python trainer for most of my life so I can help explain to you why certain approaches are better than others, so you’ll have more context for your next data problem. You might also look at Datasette.io ( says there’s a beta cloud ver?)
Replying to
This is why you need source control even if you are the only person in the team. Check in with a meaningful comment every time you make progress and you will be able to recreate what you did. git and mercurial are free and popular. Long ago I used subversion at work.
Replying to
There are many ways to do this. You could first define the range of numbers in a numpy array, like: rng = np.arange(start, end) Then you can use Series.isin: data[column_name].Isin(rng) This will give you a boolean series that you can use to subset rows from your data.