Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
krynju committed Jun 12, 2022
1 parent 14cd39b commit 7dd368d
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/table/dataframes_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,21 @@ end
manipulate(df::DTable, c::ColumnIndex; copycols::Bool, keeprows::Bool, renamecols::Bool) =
manipulate(df, Int[index(df)[c]], copycols=copycols, keeprows=keeprows, renamecols=renamecols)

# Copied as is from DataFrames.jl

"""
select(df::DTable, args...; copycols::Bool=true, renamecols::Bool=true)
Create a new DTable that contains columns from `df` specified by `args` and return it.
The result is guaranteed to have the same number of rows as df, except when no columns
are selected (in which case the result has zero rows).
This operation is supposed to provide the same functionality and syntax as `DataFrames.select`,
but for DTable input. Most cases should be covered and the output should be exactly the
same as one obtained using DataFrames. In case of output differences or `args` causing errors
please file an issue with reproduction steps and data.
Please refer to DataFrames documentation for more details on usage.
"""
select(df::DTable, @nospecialize(args...); copycols::Bool=true, renamecols::Bool=true) =
manipulate(df, map(x -> broadcast_pair(df, x), args)...,
copycols=copycols, keeprows=true, renamecols=renamecols)

0 comments on commit 7dd368d

Please sign in to comment.