Skip to content

BUG: setting object dtype Series row with an Extension Array #38271

Closed
@arw2019

Description

@arw2019

On 1.2 master:

In [11]: import numpy as np
    ...: import pandas as pd
    ...: 
    ...: ser = pd.Series(1, index=list("abcde"), dtype="object")
    ...: 
    ...: expected = pd.array([0,0,3,0,0])
    ...: ser.loc["a"] = expected
    ...: result = ser[0]

In [12]: ser
Out[12]: 
a    0
b    0
c    3
d    0
e    0
dtype: Int64

I expect:

In [14]: ser
Out[14]: 
a    [0, 0, 3, 0, 0]
b               1
c               1
d               1
e               1
dtype: object

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugExtensionArrayExtending pandas with custom dtypes or arrays.IndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions