Skip to content

Commit

Permalink
CompatHelper: bump compat for "DataFrames" to "0.22" (#24)
Browse files Browse the repository at this point in the history
* Add compat with DataFrames 0.22
* Drop compat with DataFrames 0.19 and 0.20
  • Loading branch information
github-actions[bot] authored Nov 24, 2020
1 parent 0f20343 commit c92598d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ StatsModels = "3eaba693-59b7-5ba5-a881-562e759f1c8d"

[compat]
Compat = "^3.0"
DataFrames = "0.19, 0.20, 0.21"
DataFrames = "0.21, 0.22"
DataStructures = "0.17, 0.18"
Distributions = "0.20, 0.21, 0.22, 0.23, 0.24"
Formatting = "^0.3.3, 0.4"
Expand Down
4 changes: 2 additions & 2 deletions src/QuickTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ end
function tabulate(df::AbstractDataFrame, field::Symbol)

# Count the number of observations by `field`
tab = by(df, field, _N = field => length)
tab = combine(groupby(df, field), field => length => :_N)

# Construct a Frequency Column
sort!(tab, field)
Expand All @@ -116,7 +116,7 @@ function tabulate(df::AbstractDataFrame, field1::Symbol, field2::Symbol)
# Count the number of observations by `field`
fields = vcat(field1, field2)
df = dropmissing(df[!,fields], disallowmissing=true)
tab = by(df, fields, _N = field1 => length)
tab = combine(groupby(df, fields), field1 => length => :_N)
sort!(tab, [field1, field2])

# Put it into wide form
Expand Down

0 comments on commit c92598d

Please sign in to comment.