1
0
mirror of https://github.com/elisspace/weatherdisplay.git synced 2026-08-29 15:44:11 +00:00

Update TideTracker.py

Handle empty rows with pandas `dropna`
This commit is contained in:
Eli
2025-03-05 17:10:46 -05:00
committed by GitHub
parent aedfdf5465
commit 3351142e8b

View File

@@ -253,7 +253,9 @@ def get_tide_data(station_id):
df.set_index('t', inplace=True)
# Convert 'v' to float
df['v'] = df['v'].astype(float)
df['v'] = pd.to_numeric(df['v'], errors='coerce')
df.dropna(subset=['v'], inplace=True) #double check spacing here, weird copy/paste issue
print("WaterLevel data structure:")
print(df.head())