KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a user defined number which I want to compare to a certain column of a dataframe. I would like to return the rows of a dataframe which contain (in a certain column of df, say, df.num) the 5 closest numbers to the given number x. Any suggestions for the best way to do this without loops would be greatly appreciated.
Tags (comma-separated)
Save Edits
Cancel