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

CategoricalArray do not seem supported (Stackoverflow) #277

Closed
kafisatz opened this issue Jun 25, 2020 · 2 comments
Closed

CategoricalArray do not seem supported (Stackoverflow) #277

kafisatz opened this issue Jun 25, 2020 · 2 comments

Comments

@kafisatz
Copy link

kafisatz commented Jun 25, 2020

I get a StackOverflowError for this MWE (Windows, Julia 1.4)

using Pkg 
Pkg.activate(mktempdir())
Pkg.add("JLD");Pkg.add("DataFrames")

using JLD
using DataFrames

df=DataFrame(x=rand(100),y=repeat(vcat("a"),100))

fi=joinpath(mktempdir(),"afile.jld")
@save fi df

fi=joinpath(mktempdir(),"bfile.jld")
categorical!(df) 
@save fi df #fails

 versioninfo()
Julia Version 1.4.2
Commit 44fa15b150* (2020-05-23 18:35 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i9-7980XE CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 16
  JULIA_EDITOR = "C:\Program Files\Microsoft VS Code\Code.exe"

(jl_cm7Gdp) pkg> st
Status `C:\Users\bernhard.konig\AppData\Local\Temp\jl_cm7Gdp\Project.toml`
  [a93c6f00] DataFrames v0.21.3
  [4138dd39] JLD v0.10.0
@kafisatz
Copy link
Author

I note that PooledArray works just fine, thus I used this workaround (which is sufficient for my current use case) to first convert to String[] and then to PooledArray

df[!,i] = DataFrames.PooledArrays.PooledArray(convert(Vector{String},df[!, i]))

@kafisatz
Copy link
Author

categorical!(df) seems to be an outdated function.

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

1 participant