Skip to content

shifting across blocks results in NaNs if dataframe has multiple blocks (mixed types) #11061

Closed
@hhuuggoo

Description

@hhuuggoo

variant of #10907

In [1]: import pandas as pd

In [2]: df = pd.DataFrame({'a' : [1],'b':[2]})

In [3]: df
Out[3]: 
   a  b
0  1  2

In [4]: df['c'] = 3.5

In [5]: df.shift(axis=1)
Out[5]: 
    a  b   c
0 NaN  1 NaN

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions