Skip to content

[Question] Representation of empty fields in lake package construction #500

@bdestombe

Description

@bdestombe

I have a geojson that contains all the configurations for the lakes of my model. Many of the configurations are strings. When stored to geojson and later loaded, the empty fields are represented by empty strings. To be expected I would say.

However, in the code the methods .isna(), notna() are used and they don't mark "" as na.

pd.isna("")
    False

lake_gdf["lakeout"].isna() | lake_gdf["lakeout"].eq("") could be used instead. Or on the user side do gdf.replace("", None).

An example are the boundary names in lakeout column. How are you guys handling the columns with a string data type and missing values?

My goejson:
https://github.com/NHFLO/data/blob/main/src/nhflodata/data/mockup/lakes_pwn/v1.0.0/lakes_pwn.geojson

if use_outlets and (not lake_gdf["lakeout"].isna().all()):

if pd.isna(datavar): # None or nan

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