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

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

Description

@muxevola

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]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions