Skip to content

Commit

Permalink
Merge pull request #40 from rffscghg/df-stack
Browse files Browse the repository at this point in the history
Replace `stack` with `DataFrames.stack`
  • Loading branch information
lrennels authored Aug 31, 2023
2 parents 089b278 + 1eecdde commit 72bdbee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/SPs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ end
g_datasets[:ypc1990] = load(joinpath(datadep"rffsps_v5", "ypc1990", "rffsp_ypc1990.csv")) |>
DataFrame |>
i -> insertcols!(i, :sample => 1:10_000) |>
i -> stack(i, Not(:sample)) |>
i -> DataFrames.stack(i, Not(:sample)) |>
i -> rename!(i, [:sample, :country, :value]) |>
@groupby(_.sample) |>
@orderby(key(_)) |>
Expand Down
2 changes: 1 addition & 1 deletion test/test_API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ population1990 = load(joinpath(@__DIR__, "..", "data", "population1990.csv")) |>
ypc1990 = load(joinpath(datadep"rffsps_v5", "ypc1990", "rffsp_ypc1990.csv")) |>
DataFrame |>
i -> insertcols!(i, :sample => 1:10_000) |>
i -> stack(i, Not(:sample)) |>
i -> DataFrames.stack(i, Not(:sample)) |>
DataFrame |>
@filter(_.sample == id) |>
DataFrame |>
Expand Down
2 changes: 1 addition & 1 deletion test/test_SPs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ population1990 = load(joinpath(@__DIR__, "..", "data", "population1990.csv")) |>
ypc1990 = load(joinpath(datadep"rffsps_v5", "ypc1990", "rffsp_ypc1990.csv")) |>
DataFrame |>
i -> insertcols!(i, :sample => 1:10_000) |>
i -> stack(i, Not(:sample)) |>
i -> DataFrames.stack(i, Not(:sample)) |>
DataFrame |>
@filter(_.sample == id) |>
DataFrame |>
Expand Down

0 comments on commit 72bdbee

Please sign in to comment.