You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c8ae828
Browse filesBrowse the repository at this point in the historyBrowse files
Migrate MatchVariables to narwhals, add polars support (#1063)
* Migrate MatchVariables to narwhals, add polars support
fit() and transform() take any narwhals-supported dataframe and return
the same backend. pandas adds, drops and reorders the columns with a
single reindex (faster than the previous drop/setitem/select and than
narwhals at 10k-500k rows); other backends use with_columns + select.
With match_dtypes, pandas keeps its dtypes and astype, since narwhals
dtypes don't hold the categories of pandas categoricals. Other
backends store narwhals dtypes and cast with narwhals, turning values
outside Enum categories into nulls and parsing strings into dates, as
pandas does.
With polars, np.nan fill values add null Float64 columns and integer
fill values add Int64 columns. The verbose messages list the variables
in a fixed order: training order for added variables, input order for
dropped ones. Init error messages now end with "Got {param} instead.".
Rewrite the tests to the make_df conventions and add a polars example
to the docstring and the user guide, refreshing its outputs.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Keep the dtypes learned by MatchVariables private and allow missing data in integer and boolean variables
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Mark polars output blocks in the user guide as text
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0 commit comments