Skip to content

Collect the observations into a pandas DataFrame - #58

Merged
pnuu merged 3 commits into
mainfrom
feature/pandas-dataframes
Sep 9, 2026
Merged

pnuu merged 3 commits into
mainfrom
feature/pandas-dataframes

Conversation

@pnuu

@pnuu pnuu commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Fixes #4.

Everyone who wants the observations in pandas has been writing the same loop, and the two in the report do not agree - the first one breaks on the timeseries layout, where the times are a list rather than a measurement. MultiPoint knows which layout it holds, so it can do the conversion itself.

to_dataframe() gives a frame indexed by time and station with a column per parameter, built from either layout and giving the same frame for both. The units and the station coordinates go into frame.attrs, there being nowhere else for them, and exclude_empty=True drops the parameters that a bounding box returned but nothing in it measures. pandas is an optional dependency.

Claude-Session: https://claude.ai/code/session_014exvkg8KnHXXTw1hPzbFcq

pnuu and others added 3 commits September 9, 2026 09:00
Fixes #4.

Everyone who wants the observations in pandas has been writing the same loop,
and the two in the report do not agree - the first one breaks on the timeseries
layout, where the times are a list rather than a measurement.  MultiPoint knows
which layout it holds, so it can do the conversion itself.

to_dataframe() gives a frame indexed by time and station with a column per
parameter, built from either layout and giving the same frame for both.  The
units and the station coordinates go into frame.attrs, there being nowhere else
for them, and exclude_empty=True drops the parameters that a bounding box
returned but nothing in it measures.  pandas is an optional dependency.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014exvkg8KnHXXTw1hPzbFcq
Two conflicts, both of them the same shape: main has grown the NetCDF support
since this branch started, and each side added its own optional dependency and
the installation note that goes with it.  Both belong there, so both are kept -
"netcdf" and "pandas" as extras, with "all" pulling in the two of them along
with rasterio and eccodes, and the README describing each install in turn.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014exvkg8KnHXXTw1hPzbFcq
@pnuu
pnuu merged commit 12527a2 into main Sep 9, 2026
10 checks passed
@pnuu
pnuu deleted the feature/pandas-dataframes branch September 9, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pandas interface for observation timeseries

1 participant