diff --git a/src/DataFrames.jl b/src/DataFrames.jl index c0eb6dabc8..610a1c639a 100644 --- a/src/DataFrames.jl +++ b/src/DataFrames.jl @@ -73,10 +73,10 @@ include("other/utils.jl") include("other/index.jl") include("abstractdataframe/abstractdataframe.jl") -include("dataframerow/dataframerow.jl") include("dataframe/dataframe.jl") include("subdataframe/subdataframe.jl") include("groupeddataframe/grouping.jl") +include("dataframerow/dataframerow.jl") include("dataframerow/utils.jl") include("abstractdataframe/iteration.jl") diff --git a/src/dataframe/dataframe.jl b/src/dataframe/dataframe.jl index e0e5743e95..82b44d5aeb 100644 --- a/src/dataframe/dataframe.jl +++ b/src/dataframe/dataframe.jl @@ -256,6 +256,9 @@ ncol(df::DataFrame) = length(index(df)) # Let getindex(columns(df)[j], row_inds) from AbstractVector() handle # the resolution of row indices +# TODO: change Real to Integer in this union after deprecation period +const ColumnIndex = Union{Real, Symbol} + # df[SingleColumnIndex] => AbstractDataVector function Base.getindex(df::DataFrame, col_ind::ColumnIndex) selected_column = index(df)[col_ind] @@ -1061,8 +1064,6 @@ function Base.push!(df::DataFrame, iterable::Any) df end -Base.push!(df::DataFrame, r::DataFrameRow) = push!(df, values(r)) - ############################################################################## ## ## Reorder columns diff --git a/src/deprecated.jl b/src/deprecated.jl index 82f3a903d0..453a55f02b 100644 --- a/src/deprecated.jl +++ b/src/deprecated.jl @@ -1339,6 +1339,9 @@ import Base: vcat import Base: collect @deprecate collect(r::DataFrameRow) collect(pairs(r)) +# Once `collect(::DataFrameRow)` emits values this method is no longer necessary +Base.push!(df::DataFrame, r::DataFrameRow) = push!(df, values(r)) + import Base: show @deprecate show(io::IO, df::AbstractDataFrame, allcols::Bool, rowlabel::Symbol, summary::Bool) show(io, df, allcols=allcols, rowlabel=rowlabel, summary=summary) @deprecate show(io::IO, df::AbstractDataFrame, allcols::Bool, rowlabel::Symbol) show(io, df, allcols=allcols, rowlabel=rowlabel) diff --git a/src/other/index.jl b/src/other/index.jl index 081842ec9c..7fba60dd25 100644 --- a/src/other/index.jl +++ b/src/other/index.jl @@ -3,9 +3,6 @@ # through cleanly. abstract type AbstractIndex end -# TODO: change Real to Integer in this union after deprecation period -const ColumnIndex = Union{Real, Symbol} - mutable struct Index <: AbstractIndex # an OrderedDict would be nice here... lookup::Dict{Symbol, Int} # name => names array position names::Vector{Symbol}