-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add categorical/factors dtype #261
Comments
@jsonbecker Do you have thoughts on ergonomics/ease of use with factors? What can we do to make them easy to work with and intuitive beyond copying R? |
I have controversial opinions about factors. In my mind, there are two reasons to use factors:
I think reason (1) is dumb. Assertive programming of various types are better for explicit validation. On (2), I'm not sure how much the broader Nx ecosystem is going to be "smart" about these things. I find factors in R fantastic once they exist correctly because much of the ecosystem can then interpret them well. I find the ergonomics of working directly with them to be abysmal. So how can working with factors be less abysmal? I'd say a few things help.
|
Categorical types are in, mostly for integration with Nx. We can revisit this issue with more integrated features later on if desired. |
Pandas: https://pandas.pydata.org/docs/user_guide/categorical.html
R: https://r4ds.had.co.nz/factors.html
Polars: https://docs.rs/polars/0.21.1/polars/docs/performance/index.html#categorical-type
The text was updated successfully, but these errors were encountered: