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

Lesson 5: grid.replace() fails with geometry data #14

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

Lesson 5: grid.replace() fails with geometry data #14

muxevola opened this issue Jun 13, 2020 · 0 comments

Comments

@muxevola
Copy link

The following code:

# Replace No Data values (-1) with large number (999)
grid = grid.replace(-1, 999)

Fails with the below error:

TypeError: Value should be either a BaseGeometry or None, got 999

Replaced with the below code, which limits the change to the first 14 columns (i.e. geometry column excluded):

for col in grid.columns[:14]:
    grid[col].replace(-1, 999, inplace=True)
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