-
Notifications
You must be signed in to change notification settings - Fork 7
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
Support parse(type, str)
in @mutete and @transmute
#42
Comments
|
The original code doesn't work because Tidier looks for a column named Int64. The following code uses interpolation to let Tidier know that Int64 is coming from the global environment and should work (though I haven't tested to confirm).
However, I would like to fix this behavior so that keywords like Int64 and true/false don't require interpolation. I'll leave this issue open until we fix it. |
This is now fixed in #69. Here is the output from the fixed version: julia> df = DataFrame(A = ["1", "2"])
2×1 DataFrame
Row │ A
│ String
─────┼────────
1 │ 1
2 │ 2
julia> @mutate(df, B = parse(Int64, A))
2×2 DataFrame
Row │ A B
│ String Int64
─────┼───────────────
1 │ 1 1
2 │ 2 2 |
Hi all,
@mutate
and@transmute
cannot recognize a function's arguments correctly.For example, the
parse(type, str)
function converts the string to another type, but@mutate
recognizes the first argument, which is a target type, as the variable in the data frame.The following code returns
ERROR: ArgumentError: column name :Int64 not found in the data frame
The text was updated successfully, but these errors were encountered: