datatable icon indicating copy to clipboard operation
datatable copied to clipboard

Create Equivalent Methods for Existing Datatable Functions

Open samukweku opened this issue 4 years ago • 5 comments

This is a follow-up from the discussion here on adding methods to FExpr.

The method chaining format would look like this DT[:, f[:].rowsum().sum()], which would be an equivalent for DT[:, dt.rowsum(dt.sum(f[:]))]

Methods:

  • [ ] time methods
  • [ ] str methods
  • [ ] math methods
  • [ ] cut
  • [ ] qcut
  • [ ] cov
  • [ ] corr

samukweku avatar Apr 23 '21 04:04 samukweku

@st-pasha , @oleksiyskononenko If you would be kind to show me how to pull this off for one of the existing functions (e.g sum). I tried using the same idea as for len, since I was not changing any C++ code, but it did not reflect when I restarted the python console

samukweku avatar Apr 23 '21 04:04 samukweku

Hi @samukweku -- please see PR #2949 which implements the sum function. Most of it is self-explanatory: tests, documentation, etc. Most of the changes to C++ are in lines 331-345 of "fexpr.cc".

st-pasha avatar Apr 29 '21 02:04 st-pasha

@st-pasha Thank you very much! I'll go through them tonight. Again, thank you!!

samukweku avatar Apr 29 '21 02:04 samukweku

@samukweku Do you want to create a list of methods in this issue that we need to implement for the existing dt functions? So that we keep track as to what is implemented and what is left.

oleksiyskononenko avatar Apr 22 '22 00:04 oleksiyskononenko

@oleksiyskononenko we also need to make method chaining work on dt.expr as well; at the moment it does not work on dt.expr objects

samukweku avatar Aug 01 '22 06:08 samukweku