Skip to content

Commit 527910e

Browse files
committed
add support for DataFrames 0.22
1 parent f7cb5a3 commit 527910e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2424
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
2525

2626
[compat]
27-
DataFrames = "0.21"
27+
DataFrames = "0.21,0.22"
2828
DataStructures = "0.11,0.12,0.13,0.14,0.15,0.16,0.17,0.18"
2929
Discretizers = "3.0"
3030
Distributions = "0.17,0.18,0.19,0.20,0.21,0.22,0.23,0.24"

src/DiscreteBayesNet/tables.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function sumout(t::Table, v::NodeNameUnion)
6666
else
6767
# note that this will fail miserably if f is too large (~1E4 maybe?)
6868
# nothing I can do; there is a github issue
69-
return Table(by(f, remainingvars, df -> DataFrame(p = sum(df[!,:p]))))
69+
return Table(combine(df -> DataFrame(p = sum(df[!,:p])), DataFrames.groupby(f, remainingvars)))
7070
end
7171
end
7272

test/test_factors.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bn = rand_discrete_bn(10, 4)
4545
name = :N5
4646

4747
ϕ = Factor(bn, name)
48-
df = join(DataFrame(ϕ), table(bn, name).potential, on=names(ϕ))
48+
df = innerjoin(DataFrame(ϕ), table(bn, name).potential, on=names(ϕ))
4949
diff = abs.(df[!,:p] - df[!,:potential])
5050

5151
@test all(diff .< 1E-13)

0 commit comments

Comments
 (0)