Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to extract data and labels of column from .SAV file? #47

Open
programistawpf opened this issue Mar 13, 2019 · 1 comment
Open

How to extract data and labels of column from .SAV file? #47

programistawpf opened this issue Mar 13, 2019 · 1 comment
Labels

Comments

@programistawpf
Copy link

How to extract data and labels of column frm SAV file? Is posible convert to nativ Array of Julia ?
Why my A.labels is empty ?

julia> A=read_sav("test.sav")
ReadStatDataFrame(Any[DataValues.DataValue{Float
2.0, 2.0], DataValues.DataValue{Float64}[0.13964
ataType[Float64, Float64, Float64], ["", "", ""]
00000008, 0x0000000000000008], Int32[1, 1, 1], I
.0=>"facet",1.0=>"kob"),"labels1"=>Dict(2.0=>"mi

julia> A
ReadStatDataFrame(Any[DataValues.DataValue{Float64}[1.0, 2.0, 1.0, 2.0], DataValues.DataValue{Float64}[1.0, 1.0,
2.0, 2.0], DataValues.DataValue{Float64}[0.139644, 0.431302, 0.612179, 0.290753]], Symbol[:plec, :klwm, :waga], D
ataType[Float64, Float64, Float64], ["", "", ""], ["F8.2", "F8.2", "F8.2"], UInt64[0x0000000000000008, 0x00000000
00000008, 0x0000000000000008], Int32[1, 1, 1], Int32[0, 0, 0], ["labels0", "labels1", ""], Dict("labels0"=>Dict(2
.0=>"facet",1.0=>"kob"),"labels1"=>Dict(2.0=>"miasto",1.0=>"wiocha")), 4, 3, "", 2019-03-13T13:57:49, 2)
julia> A.data
3-element Array{Any,1}:
DataValues.DataValue{Float64}[1.0, 2.0, 1.0, 2.
DataValues.DataValue{Float64}[1.0, 1.0, 2.0, 2.
DataValues.DataValue{Float64}[0.139644, 0.43130

julia> A.labels
3-element Array{String,1}:
""
""
""
ulia> A.labels[1]
"

ulia> A.labels[2]
"

ulia> A.labels[3]
"

Thanks, Paul

@programistawpf programistawpf changed the title How to extract data and labels of column frm SAV file? How to extract data and labels of column from .SAV file? Mar 13, 2019
@programistawpf
Copy link
Author

programistawpf commented Mar 21, 2019

I need to extract this array:

Symbol[:plec, :klwm, :waga]

from A . They are my var_labels, how to do it now?
Paul

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants