I'm learning Python and this has been a bit of a challenge!

My DataFrame looks like this below.

             name                   geometry
0     Uimastadion  POINT (24.93045 60.18882)
1  Hartwall Arena  POINT (24.92918 60.20570)
2           Talli  POINT (24.92607 60.21346)

I would like to create some sort of function on Python that takes an input (an address or name of a single point) then returns the nearest (say 10 0r 100) neighbors including their distances.

I've found this below but its not what I'm looking for.


How can I do this?

  • What about your reference isn't what your looking for? Did you see that get_nearest accepts a parameter for the number of nearest neighbors? – rickhg12hs Jan 28 '20 at 19:12
  • That function doesn't seem to work on its own. it returns this error. (float() argument must be a string or a number, not 'Point') . Also, the first part about taking in a value for input. Is this something possible – user2987639 Jan 28 '20 at 21:44
  • I think you are probably having some problems using Python. Could you edit your post to show some minimal examples with the issues you are having? – rickhg12hs Jan 28 '20 at 21:50