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

ordered vs ordinal #398

Open
alecloudenback opened this issue Dec 8, 2022 · 3 comments
Open

ordered vs ordinal #398

alecloudenback opened this issue Dec 8, 2022 · 3 comments

Comments

@alecloudenback
Copy link

alecloudenback commented Dec 8, 2022

Maybe the ship has sailed, but would ordinal be a clarifying terminology change? I was confused when I first saw the first call below because I thought ordered=true would be saying that the array is already sorted.

x = CategoricalArray(["Old", "Young", "Middle", "Young"], ordered=true)
levels!(x, ["Young", "Middle", "Old"])

might become

x = CategoricalArray(["Old", "Young", "Middle", "Young"], ordinal=true)
order!(x, ["Young", "Middle", "Old])
@bkamins
Copy link
Member

bkamins commented Dec 8, 2022

Well it is pre 1.0 release, but it would be quite a big change. Let us see what @nalimilan thinks 😄.

@ablaom
Copy link

ablaom commented Dec 15, 2022

I can see where this is coming from but must admit this never confused me, as an outside user. I do like that order! is a verb while levels! is a noun. For my part however, I feel this is a very minor semantic point, and would prefer to avoid the substantial disruption.

@nalimilan
Copy link
Member

The "ordered" terminology comes from R. Probably "ordinal" would have been a better term, but I'm not convinced that changing it now would be worth the breakage either. Note that in Julia the term referring to data that is already sorted would be... "sorted" (as in searchsortedfirst and SortedDict; see also occurrences in packages).

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

No branches or pull requests

4 participants