Skip to content
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 Series.categories/1 #465

Merged
merged 4 commits into from
Jan 10, 2023
Merged

Conversation

philss
Copy link
Contributor

@philss philss commented Jan 9, 2023

This function is useful to retrieve only the categories from a categorical series.
The resultant series is of ":string" dtype.

This function is useful to retrieve only the categories from a
categorical series. The resultant series is of ":string" dtype.
@philss philss requested a review from josevalim January 9, 2023 21:37
@doc """
Return a series with the category names of a categorical series.

Each category has the index equal to its position.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add a note that no order is guaranteed for the categories?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. For what I could understand, the ordering is defined by the order the elements appear in the series. But this is not clear.

Internally there is a flag to the the ordering to lexical: https://pola-rs.github.io/polars/polars_core/datatypes/categorical/struct.CategoricalChunked.html#method.set_lexical_sorted

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is defined like that but mostly as an implementation accident and not a guarantee? Providing fewer guarantees doesn’t hurt anyway :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Note added 👍

@philss philss merged commit a99c5b6 into elixir-explorer:main Jan 10, 2023
@philss philss deleted the ps-add-s-categories branch January 10, 2023 00:36
liamdiprose pushed a commit to liamdiprose/explorer that referenced this pull request Feb 16, 2023
…nt-release

Prepare rustler_bigint release
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.

2 participants