JuliaPy/Pandas.jl

subtract and division bug

AStupidBear opened this issue · 3 comments

x = [1, 2, 3]
df = DataFrame(Dict(:x => x))
1 - df["x"] 
1 / df["x"]

julia> 1 - df["x"]
0    0
1    1
2    2
Name: x, dtype: int64

julia> 1 / df["x"]
0    1.0
1    2.0
2    3.0
Name: x, dtype: float64

I can't reproduce this on master. I'm seeing correct results:

julia> using Pandas
[ Info: Recompiling stale cache file /Users/malmaud/.julia/compiled/v1.0/Pandas/bc5zI.ji for Pandas [eadc2687-ae89-51f9-a5d9-86b5a6373a9c]

julia> x=[1,2,3]
3-element Array{Int64,1}:
 1
 2
 3

julia> df=DataFrame(Dict(:x=>x))
   x
0  1
1  2
2  3


julia> df
   x
0  1
1  2
2  3


julia> 1-df[:x]
0    0
1   -1
2   -2
Name: x, dtype: int64


julia> 1/df[:x]
0    1.000000
1    0.500000
2    0.333333
Name: x, dtype: float64

Of course, that's fixed by #30

Ah, of course. Thanks again for helping out.