I am trying to cache a function and I’m getting an error that is pointing towards these lines of code:
result = [[geopy.distance.geodesic(coords1, coords2).km for coords1 in list2] for coords2 in list1] filtered_inside_radius = [[1 if y <= radius and y > 0 else 0 for y in x] for x in result]
The code calculates the distance between points in two lists and then filters the results based on “radius” which is a streamlit slider.
I don’t see anything that would obviously be causing an error. Any thoughts?