Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Lesson 4: Nearest points using Geopandas - get_values() #13

Open
muxevola opened this issue Jun 11, 2020 · 0 comments
Open

Lesson 4: Nearest points using Geopandas - get_values() #13

muxevola opened this issue Jun 11, 2020 · 0 comments

Comments

@muxevola
Copy link

When applying the user defined function nearest() to the GeoDataFrame df1 you get the below error:

AttributeError: 'Series' object has no attribute 'get_values'

This is caused by this line in the function:

value = df2[nearest][src_column].get_values()[0]

And that's because pandas.DataFrame.get_values() was deprecated in Pandas since version 0.25.0 (I'm using Pandas v1.0.4 and Geopandas v0.7.0).

The below code works:

value = df2[nearest][src_column].values[0]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant