Closed BuddhiLW closed 3 years ago
The problem is with:
X_synth[:, j] = ...
as j
is an integer.
Note the following:
julia> using DataFrames
julia> df = DataFrame()
0×0 DataFrame
julia> df[:, 1] = [1, 2, 3]
ERROR: ArgumentError: Cannot assign to non-existent column: 1
julia> df[:, "x1"] = [1, 2, 3]
3-element Vector{Int64}:
1
2
3
julia> df
3×1 DataFrame
Row │ x1
│ Int64
─────┼───────
1 │ 1
2 │ 2
3 │ 3
You cannot refer using an integer index to a non existing column. However, you can CREATE it if you give it a name. What name you want to use is up to you, but the simplest would probably be e.g.:
X_synth[:, Symbol(:x, j)] = ...
In general it is better to as such questions either on StackOverflow with julia
and dataframe
tags, or on Slack in #data channel. In this way more people are likely to see your question so you are likely to get the response faster in general.
We usually keep GitHub issues for reporting feature requests or bugs to the package. Thank you!
I whom thank you @bkamins
I was able to make it work. There was a place that I had to change names!
to renames!
, and all worked out smoothly from there.
I will now make a pull request to ClassImabalance.jl @DilumAluthge has been pretty fast and attentive when I went there.
Julia has a great community behind all its functionalities. Great to be a tinny part in it and see it happening.
Great. If you have any further questions please do not hesitate to ask.
Hello, I'm working on
ClassImbalance.jl
,When I was updating DataFrames v0.20 to v1.2.2, I had the following problem:
[src/smote_exs.jl] The function
matrix_to_dataframe
is defined as,[src/utils.jl] In turn, it calls
float_to_factor
The problem in the repl, returns:
with
I was testing
matrix_to_dataframe
with:Inspecting step by step of the
matrix_to_dataframe
, I stumbled withCan you lend me a hand on how to solve this one? I guess the problem is with how to make a logic-firewall, in case data == 0x0 DataFrame, then <do something that actually can be accessed in position 1>.