Skip to content

Commit

Permalink
Merge pull request #1384 from bjarthur/bja/depwarn
Browse files Browse the repository at this point in the history
fix DataFrames deprecation warnings
  • Loading branch information
bjarthur authored Jan 18, 2020
2 parents fb97e75 + 5683dcc commit aec6dad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/dataframes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function meltdata(U::AbstractDataFrame, colgroups::Vector{Col.GroupedColumn})
vnames = Symbol[]
colmap = Dict{Any, Int}()

eltypd = Dict(k=>v for (k,v) in zip(names(U), eltypes(U)))
eltypd = Dict(k=>v for (k,v) in zip(names(U), eltype.(eachcol(U))))
# allocate vectors for grouped columns
for (j, (colgroup, colidx)) in enumerate(zip(colgroups, colidxs))
eltyp = promote_type(getindex.([eltypd], colidx)...)
Expand Down
6 changes: 4 additions & 2 deletions test/testscripts/issue975.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ t1 = Date("2001-01-15"):Dates.Month(1):Date("2016-12-31")
t2 = DateTime("2001-01-15"):Dates.Month(1):DateTime("2016-12-31")
t = Float64.(Dates.value.(t1))
n = length(t)
D = DataFrame(t1=t1, t2=t2, cycle = 5*sin.(t*2π/365.25)+randn(n), trend = 0.1*[1.0:n;].+2*randn(n))
Dl = melt(D,[:t1,:t2])
D = DataFrame(t1=t1, t2=t2,
cycle = 5*sin.(t*2π/365.25)+randn(n),
trend = 0.1*[1.0:n;].+2*randn(n))
Dl = stack(D, setdiff(names(D), [:t1,:t2]))

plot(D,
x=:t1, y=:trend, Geom.point,
Expand Down
2 changes: 1 addition & 1 deletion test/testscripts/subplot_grid.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set_default_plot_size(10inch, 10inch)
barley = dataset("lattice", "barley")
levels!(barley.Year, ["1931", "1932"])

idx = [startswith(x,"No.") for x in barley.Variety]
idx = [startswith(String(x),"No.") for x in barley.Variety]
plot(barley[idx,:],
xgroup="Variety", ygroup="Site", x="Year", y="Yield",
Geom.subplot_grid(Geom.line, Geom.point))
2 changes: 1 addition & 1 deletion test/testscripts/subplot_grid_free_axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set_default_plot_size(10inch, 10inch)
barley = dataset("lattice", "barley")
levels!(barley.Year, ["1931", "1932"])

idx = [startswith(x,"No.") for x in barley.Variety]
idx = [startswith(String(x),"No.") for x in barley.Variety]
plot(barley[idx,:],
xgroup="Variety", ygroup="Site", x="Year", y="Yield",
Geom.subplot_grid(Geom.line, Geom.point,
Expand Down

0 comments on commit aec6dad

Please sign in to comment.