Skip to content

Commit

Permalink
Added frame::to_series(Ex)
Browse files Browse the repository at this point in the history
  • Loading branch information
tedmiddleton committed Apr 29, 2023
1 parent 19e45d3 commit d8aefda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mainframe/frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,10 @@ class frame
template<size_t Ind>
double stddev(columnindex<Ind>) const;

template<typename T, typename Ex>
series<T>
to_series(const std::string& column_name, Ex expr) const;

std::vector<std::vector<std::string>>
to_string() const;

Expand Down
10 changes: 10 additions & 0 deletions mainframe/impl/frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,16 @@ frame<Ts...>::stddev(columnindex<Ind>) const
return s.stddev();
}

template<typename... Ts>
template<typename T, typename Ex>
series<T>
frame<Ts...>::to_series(const std::string& series_name, Ex expr) const
{
frame<Ts..., T> plust = append_column<T>(series_name, expr);
columnindex<sizeof...(Ts)> ci;
return plust.column(ci);
}

template<typename... Ts>
std::vector<std::vector<std::string>>
frame<Ts...>::to_string() const
Expand Down

0 comments on commit d8aefda

Please sign in to comment.