From 7dd368d8131c995a7b02dc31c27fef03429de266 Mon Sep 17 00:00:00 2001 From: krynju Date: Sun, 12 Jun 2022 20:14:26 +0200 Subject: [PATCH] add docs --- src/table/dataframes_interface.jl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/table/dataframes_interface.jl b/src/table/dataframes_interface.jl index 9c05b3954..70078f35d 100644 --- a/src/table/dataframes_interface.jl +++ b/src/table/dataframes_interface.jl @@ -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)