Skip to content

How to mapping ordinal_encode result value and original value? #1927

Answered by JovanVeljanoski
tommyhj217 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

For now you can do this via
df._categories. They are sorted by the way they appear in that dictionary, starting from 0.

In the future major version of vaex (i.e. vaex 5.x) when doing such encoding you will continue to see the strings, but under the hood we will treat them as ints. You can get a preview of this feature by doing:

import vaex
df = vaex.datasets.titanic()
df = df._future()  # enables v5 features (preview)
df = df.ordinal_encode('home_dest')

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by tommyhj217
Comment options

You must be logged in to vote
6 replies
@tommyhj217
Comment options

@tommyhj217
Comment options

@JovanVeljanoski
Comment options

@tommyhj217
Comment options

@maartenbreddels
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants