Skip to content

Commit eb76eb8

Browse files
COOPS NWS historical station process string nan values for station removal time (#176)
1 parent 499554f commit eb76eb8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

searvey/coops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,11 @@ def coops_stations(station_status: COOPS_StationStatus | None = None) -> GeoData
732732

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

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

739+
# Stations with NA removed value are filtered
737740
stations = (
738741
stations[~pandas.isna(stations["removed"])]
739742
.sort_values("removed", ascending=False)

0 commit comments

Comments
 (0)