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

@newcol in @byrow! not defined #54

Closed
dun10p opened this issue May 24, 2016 · 3 comments
Closed

@newcol in @byrow! not defined #54

dun10p opened this issue May 24, 2016 · 3 comments

Comments

@dun10p
Copy link

dun10p commented May 24, 2016

Hi. Sorry to be a bother. I'm getting an error saying "UndefVarError @newCol not defined", when running the block in the readme that includes @byrow! and @newCol as displayed below.

df = DataFrame(A = 1:3, B = [2, 1, 2])
df2 = @byrow! df begin
    @newcol colX::Array{Float64}
    @newcol colY::DataArray{Int}
    :colX = :B == 2 ? pi * :A : :B
     if :A > 1 
        :colY = :A * :B
    end
end

I'm trying to apply this to my own dataframe to bring separate time and date columns into a single column that contains DateTime elements. I was thinking this would work:

dateForm = Dates.DateFormat("d-u-y H")
newMachineData = @byrow! MachineData begin
@newCol DT::Array{DateTime}
:DT = DateTime(string(:DATE, " ", :HOUR), dateForm)
end

However, the error with @newCol is raised. It's likely I'm missing something simple though. I am new to Julia

@tshort
Copy link
Contributor

tshort commented May 24, 2016

It may be that the readme is ahead of the released version of
DataFramesMeta. You may have to checkout the most recent commit to get this
feature. I'm not at a location I can check easily.

---------- Forwarded message ----------
From: dun10p notifications@github.com
Date: Tue, May 24, 2016 at 3:22 PM
Subject: [JuliaStats/DataFramesMeta.jl] @newCol in @byrow! not defined (#54)
To: "JuliaStats/DataFramesMeta.jl" DataFramesMeta.jl@noreply.github.com

Hi. Sorry to be a bother. I'm getting an error saying "UndefVarError
@newCol not defined", when running the block in the readme that includes
@byrow! and @newCol as displayed below.

df = DataFrame(A = 1:3, B = [2, 1, 2])
df2 = @byrow! df begin
@newCol colX::Array{Float64}
@newCol colY::DataArray{Int}
:colX = :B == 2 ? pi * :A : :B
if :A > 1
:colY = :A * :B
end
end

I'm trying to apply this to my own dataframe to bring separate time and
date columns into a single column that contains DateTime elements. I was
thinking this would work:

dateForm = Dates.DateFormat("d-u-y H")
newMachineData = @byrow! MachineData begin
@newCol DT::Array{DateTime}
:DT = DateTime(string(:DATE, " ", :HOUR), dateForm)
end

However, the error with @newCol is raised. It's likely I'm missing
something simple though. I am new to Julia


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#54

@nalimilan
Copy link
Member

Yes, last version was in December, and these functions are newer than that AFAIK. It's indeed always confusing that you get the development version of the README when you browser a GitHub project. In the long-term, I guess documentation should move to Documenter.jl anyway.

@dun10p
Copy link
Author

dun10p commented May 25, 2016

Thank you guys! I apologize for the mistake.

@dun10p dun10p closed this as completed May 25, 2016
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

3 participants