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

Constructor for PooledArray #37

Closed
kafisatz opened this issue Aug 10, 2020 · 1 comment
Closed

Constructor for PooledArray #37

kafisatz opened this issue Aug 10, 2020 · 1 comment

Comments

@kafisatz
Copy link

In the example below, what is the best way to define y without allocating x

Is this how it should be done?

using DataFrames
x=repeat(vcat("someString"),1_000_000));
y = DataFrames.PooledArrays.PooledArray(x)

invpool=Dict{String,UInt8}("someString"=>1)
pool=DataFrames.PooledArrays._invert(invpool)
refs=repeat(vcat(UInt8(1)),1_000_000)
y2 = DataFrames.PooledArray(DataFrames.PooledArrays.RefArray(refs),invpool,pool)

@assert isequal(y,y2)
@nalimilan
Copy link
Member

Please use the Discourse forum for questions, and keep GitHub for bug reports. Thanks!

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

2 participants