danfojs icon indicating copy to clipboard operation
danfojs copied to clipboard

`DataFrame.apply` function output is inconsistent

Open applegrew opened this issue 3 years ago • 0 comments

Describe the bug DataFrame.apply is supposed to return Series however it returns a DataFrame if the original DataFrame contains no rows.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/sweet-voice-w2n0bx?file=/src/index.js
  2. The code should run on its own.
  3. Open the console and notice the outputs.
  4. When DataFrame contains rows then $isSeries is true else it is false.

Expected behavior apply should always return a Series.

Additional context Using version 1.1.1 of Danfo JS.

applegrew avatar Jul 20 '22 08:07 applegrew