Skip to content

Conversation

@beingamanforever
Copy link

tabulate: categorical and string edge-case fixes

This change improves tabulate to handle categorical and string edge cases correctly, aligning behavior more closely with MATLAB.

Fixed

  • Categorical arrays with all values undefined now return zero counts and zero percentages (instead of NaN)
  • Categorical arrays with defined but unused categories correctly include zero-count rows
  • String arrays with all values missing now return an empty table
  • Categorical logic is guarded and only enabled when categorical support is available

Tests

Added focused BISTs covering:

  • All-undefined categorical inputs
  • Empty categorical arrays with predefined categories
  • All-missing string arrays

Tests are automatically skipped when required datatypes are unavailable.

@beingamanforever beingamanforever force-pushed the fix-tabulate-categorical branch from 18c662d to 5b3af43 Compare January 15, 2026 05:17
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.

1 participant