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.
Conversation
Replying to
its been two days of me trying to figure out how to do this intermittently between surges of emotional fury and i still have not figured it out. i thought i got it at one point but turns out idk what i did and can't recreate it. the color has gone out of my life.
14
3
137
it is absurd that humanity has somehow produced such a useful thing to learn that is so unlearnable
32
4
173
Replying to
df.loc[(df["num_partners"] > x) & (df["num_partners"] < y)]
This should make a new dataframe you will need to assign with only the values in the correct range.
2
18
Show replies
Replying to
I script in R for data analysis. Contact me if you want a different approach.
1
6
Show replies
Replying to
It’s not that hard. If you’re asking people to fill in a blank, you need to sanitize your inputs so that they can only submit values you deem acceptable. Very easy to reject anything that’s not an integer. Write code as if your users are trying to break it, because they will
1
28
Show replies






