You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2026/10/15 05:47:37 UTC
[PR] feat(python/sedonadb-geopandas): add Series reductions and value counts [sedona-db]
jiayuasu opened a new pull request, #1451:
URL: https://github.com/apache/sedona-db/pull/1451
## What changes
Adds reductions and counts to `Series` in the experimental `sedonadb-geopandas` package, computed by the engine as pandas computes them:
- **Reductions:** `sum`, `mean`, `median`, `std` / `var` (`ddof` 1 or 0), `min`, `max`, `count`, and `quantile` (one `q`, or several for a Series indexed by `q`).
- **Distinct values:** `nunique` (`dropna`), `unique`, and `value_counts` (`normalize`, `sort`, `ascending`, `dropna`), which returns a pandas Series named `count` or `proportion` and indexed by value, as in pandas.
Each is checked against pandas applied to the same column, which drove these details:
- **Missing values are skipped** (pandas' `skipna=True`), NaN included: a float column's NaN is turned into null first, because the engine's aggregates would count NaN, propagate it, or sort it last. A sum of nothing is 0; the other reductions of nothing are NaN.
- **Booleans count as 0 and 1.** `median`, `std`, `var`, and `quantile` work in float (the engine's median of an integer column would truncate), and `quantile` is exact linear interpolation (`percentile_cont`).
- **`min` / `max`** also cover strings and temporal values; the arithmetic reductions of other types, geometry included, raise `TypeError`.
Differences from pandas, also in the README:
- An integer column keeps its integer type in a reduction, where pandas, having turned the column's missing values into NaN, reports a float.
- `min` / `max` of a string column skip a missing value, where pandas raises comparing it with a string.
- `unique` and `value_counts` cannot follow the order of first appearance, since a lazy frame has no row order; `value_counts` breaks ties by value. The distinct-value methods refuse geometry.
## Testing
59 new tests in `tests/test_series_reductions.py` (535 in the package, plus one expected failure), run with warnings promoted to errors against a source-built current main, the released sedonadb 0.5.0, and a nightly, under pandas 2 and 3. Ruff lint and format are clean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(python/sedonadb-geopandas): add Series reductions and value counts [sedona-db]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu commented on PR #1451:
URL: https://github.com/apache/sedona-db/pull/1451#issuecomment-6280063396
Since this PR has been open for a while, I will merge it tonight if there are no objections.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(python/sedonadb-geopandas): add Series reductions and value counts [sedona-db]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #1451:
URL: https://github.com/apache/sedona-db/pull/1451
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org