Closed DeflateAwning closed 1 month ago
Hi @DeflateAwning, check out https://docs.pola.rs/user-guide/expressions/categorical-data-and-enums/.
For sure! It could be that I'm way more experienced in Python, and don't have an intuitive understanding of what equivalent code looks like in Ruby, but I couldn't figure it out (hence opening this issue).
The following attempts didn't seem to work for me:
Polars::Enum(['val1', 'val2'])
Polars.Enum(['val1', 'val2'])
Polars::Enum.initialize(['val1', 'val2'])
Can you offer advice? I maintain that a tiny example of the syntax in the docs would be valuable.
The way to initialize a class in Ruby is with new
.
Polars::Enum.new(["val1", "val2"])
Would you mind adding that as a one-sentence example in the docs?
It's an example of where the Ruby syntax differs from the Python syntax, and so I strongly believe it should be documented.
Docs page: https://www.rubydoc.info/gems/polars-df/Polars/Enum
It would be awesome if you added an example of how to use the Enum type!
Thanks!