Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Nov 11, 2018
1 parent 52e9010 commit e42b8d3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/abstractdataframe/iteration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Base.size(itr::DataFrameColumns) = (size(itr.df, 2),)
Base.IndexStyle(::Type{<:DataFrameColumns}) = Base.IndexLinear()

function Base.getindex(itr::DataFrameColumns{<:AbstractDataFrame,
Pair{Symbol, AbstractVector}}, j::Int) =
Pair{Symbol, AbstractVector}}, j::Int)
Base.depwarn("Indexing into a return value of eachcol will return a pair " *
"of column name and column value", :getindex)
itr.df[j]
Expand Down
4 changes: 2 additions & 2 deletions src/dataframe/dataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ deletecols!(df::DataFrame, c::Any) = deletecols!(df, index(df)[c])

function deleterows!(df::DataFrame, ind::Union{Integer, UnitRange{Int}})
for i in 1:ncol(df)
_columns(df)[i] = deleteat!(rawcolumns(df)[i], ind)
_columns(df)[i] = deleteat!(_columns(df)[i], ind)
end
df
end
Expand All @@ -805,7 +805,7 @@ function deleterows!(df::DataFrame, ind::AbstractVector{Int})
keep[ikeep:end] = idf:n

for i in 1:ncol(df)
_columns(df)[i] = rawcolumns(df)[i][keep]
_columns(df)[i] = _columns(df)[i][keep]
end
df
end
Expand Down
2 changes: 1 addition & 1 deletion src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ function Base.hash(df::SubDataFrame, h::UInt)
end

function Base.getindex(itr::DataFrameColumns{<:SubDataFrame,
Pair{Symbol, AbstractVector}}, j::Int) =
Pair{Symbol, AbstractVector}}, j::Int)
Base.depwarn("Indexing into a return value of eachcol on SubDataFrame will return a pair " *
"of column name and a view of column value", :getindex)
itr.df[:, j]
Expand Down
4 changes: 2 additions & 2 deletions test/iteration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ module TestIteration
@test size(columns(df)) == (size(df, 2),)
@test length(eachcol(df)) == size(df, 2)
@test length(columns(df)) == size(df, 2)
@test eachcol(df)[1] == (:A => df[1])
@test eachcol(df)[1] == df[1] # this will be (:A => df[1]) after deprecation
@test columns(df)[1] == df[1]
@test collect(eachcol(df)) isa Vector{Pair{Symbol, AbstractVector}}
@test collect(eachcol(df)) isa Vector{AbstractVector} # this will be Vector{Pair{Symbol, AbstractVector}} after deprecation
@test collect(eachcol(df)) == [:A => Union{Missing, Int64}[1, 2]
:B => Union{Missing, Int64}[2, 3]]
@test collect(columns(df)) isa Vector{AbstractVector}
Expand Down

0 comments on commit e42b8d3

Please sign in to comment.