Skip to content

Commit

Permalink
Merge pull request #801 from fiatflux/patch-1
Browse files Browse the repository at this point in the history
Implement length(::Cols) for abstract dataframes.
  • Loading branch information
garborg committed May 22, 2015
2 parents 14eccb0 + d6fab99 commit 645bda3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/abstractdataframe/abstractdataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ end
Base.start(::Cols) = 1
Base.done(itr::Cols, st) = st > length(itr.df)
Base.next(itr::Cols, st) = (itr.df[st], st + 1)
Base.length(itr::Cols) = length(itr.df)

# N.B. where stored as a vector, 'columns(x) = x.vector' is a bit cheaper
columns{T <: AbstractDataFrame}(df::T) = Cols{T}(df)
Expand Down

0 comments on commit 645bda3

Please sign in to comment.