Skip to content

1 ** Sparse df with nans makes sp_values() produce strange results under df[] vs df.take([]) #2220

Closed
@ghost

Description

df = SparseDataFrame({    'A' : [nan, 0, 1]    }) # note : no error without nan
df = 1 ** df # note that 2 ** df works fine, also df ** 1
r1=df.take([0],1)['A']
r2=df['A']
assert len(r2.sp_values) == len(r1.sp_values)
  • I'm not familiar with the block management code so I can't figure this out
    with reasonable effort right now.
  • as a side issue, it looks like 1 ** nan == 1 in this context, seems suspect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions