Skip to content

Commit

Permalink
COOPS NWS historical station process string nan values for station re…
Browse files Browse the repository at this point in the history
…moval time (#176)
  • Loading branch information
SorooshMani-NOAA authored Feb 6, 2025
1 parent 499554f commit eb76eb8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions searvey/coops.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,11 @@ def coops_stations(station_status: COOPS_StationStatus | None = None) -> GeoData

stations.rename(columns={"Removed Date/Time": "removed"}, inplace=True)

# Make sure there's not string None values
stations.loc[stations["removed"] == "None", "removed"] = pd.NA
stations["removed"] = pandas.to_datetime(stations["removed"]).astype("string")

# Stations with NA removed value are filtered
stations = (
stations[~pandas.isna(stations["removed"])]
.sort_values("removed", ascending=False)
Expand Down

0 comments on commit eb76eb8

Please sign in to comment.