Closed jh-206 closed 8 months ago
SynopticPy will return just the data it gets from the Synoptic API. I purposely don't do any data manipulation and leave it to the use to decide what to do with what's returned.
I think what you want to do is apply df.asfreq()
to each of the returned dataframes. https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.asfreq.html
Alternatively, you can do a merge or join to get each dataframe to have the same indexes (I don't know the syntax off the top of my head, but I have used this approach before).
Right that makes sense if that's how Synoptic returns the data.
asfreq
looks promising, thanks
When collecting data for multiple stations, I often get time series of different lengths. It seems that hours with missing data are just removed from the returned dataframe. This makes it incredibly difficult to line up observations in time for multiple spatial locations.
Is there an existing way to handle this in
stations_timeseries
? My desired behavior would be to return NaN for hours with missing data, and the timestamp would still correspond to a row of the dataframe.Reproducible example: