Skip to content

BUG, dot product with empty dataframe #13466

Closed
@qian0

Description

@qian0

Dot product of empty dataframe resulted in dataframe filled with zeros.
I thought the expected ones would be empty or NaN?

In [3]: df = pd.DataFrame(index = ['a','b'])

In [4]: srs = pd.Series()

In [5]: df
Out[5]:
Empty DataFrame
Columns: []
Index: [a, b]

In [6]: srs
Out[6]: Series([], dtype: float64)

In [7]: df.dot(srs)
Out[7]:
a 0
b 0
dtype: float64

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions