Skip to content

Commit

Permalink
merged constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
joshbode committed Mar 26, 2017
1 parent a75f958 commit 7a8ae22
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/subdataframe/subdataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,14 @@ immutable SubDataFrame{T <: AbstractVector{Int}} <: AbstractDataFrame
end
end

function SubDataFrame{T <: AbstractVector{Int}}(parent::DataFrame, rows::T)
return SubDataFrame{T}(parent, rows)
function SubDataFrame{S <: Integer}(parent::DataFrame, rows::AbstractVector{S})
return SubDataFrame{AbstractVector{Int}}(parent, convert(AbstractVector{Int}, rows))
end

function SubDataFrame(parent::DataFrame, row::Integer)
return SubDataFrame(parent, [row])
end

function SubDataFrame{S <: Integer}(parent::DataFrame, rows::AbstractVector{S})
return SubDataFrame{Vector{Int}}(parent, convert(Vector{Int}, rows))
end


function Base.view{S <: Real}(df::DataFrame, rowinds::AbstractVector{S})
return SubDataFrame(df, rowinds)
Expand Down

0 comments on commit 7a8ae22

Please sign in to comment.