-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Microsoft.Data.AnalysisAll DataFrame related issues and PRsAll DataFrame related issues and PRs
Description
Suppose that I have the following DataFrame:
var df = new DataFrame(
new PrimitiveDataFrameColumn<int>("Foo", 10),
new PrimitiveDataFrameColumn<int>("Bar", Enumerable.Range(1, 10))
);When performing mathematical operations where either side is null I would expect the null to be propagated to the resulting column.
Indeed, that is what happens when the null value is the left-hand operand. E.g.
df.Columns["Foo"] + df.Columns["Bar"]Here the result is a column of nulls, but if we reverse the operands:
df.Columns["Bar"] + df.Columns["Foo"]The nulls in the Foo column are effectively treated as 0.
It looks like this occurs because the Arithmetic classes are working on the underlying buffers which don't keep track of the null values (that seems to be tracked in a separate NullBitMapBuffers property on the container).
Metadata
Metadata
Assignees
Labels
Microsoft.Data.AnalysisAll DataFrame related issues and PRsAll DataFrame related issues and PRs