Skip to content

Handling NaNs when calculating mean or sum #200

@schajee

Description

@schajee

Describe the bug
When calculating the mean() or sum() of a dataframe, NaNs are not ignored and output contains NaNs.

Issue #144 says that 0.2.0 onwards this behavior is addressed.

To Reproduce

  1. data = [[11, 20, 3], [null, 15, 6], [2, 30, 40], [2, 89, 78]]
  2. let df = new dfd.DataFrame(data)
  3. df.mean().print() or df.sum().print()

Current behavior

Mean Sum
NaN NaN
38.5 154
31.75 127

Expected behavior

Mean Sum
5 15
38.5 154
31.75 127

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: 0.2.5

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions