Good morning,

I am looking for a simple way to convert an Integer DataFrame to a Float 
DataFrame. Here is an example of the problem:

julia> using DataFrames
julia> A=DataFrame([1 2; 3 4])
2x2 DataFrame:
x1 x2
[1,] 1 2
[2,] 3 4

With multiplication, there is no problem automatically converting to Float:

julia> A*.5
2x2 DataFrame:
x1 x2
[1,] 0.5 1.0
[2,] 1.5 2.0

But with division, for example, the conversion fails:

julia> A/2
InexactError()

Ideally, there would be a one-line command so that we don't have to worry 
about this issue, say DataFloat() of the form:

julia> A=DataFloat(A)
2x2 DataFrame:
x1 x2
[1,] 1.0 2.0
[2,] 3.0 4.0

Does something like this exist?

Thanks,
Bradley

Reply via email to