Skip to content

BUG: iloc setitem indexing with list of lists #7551

Closed
@jreback

Description

@jreback

different results when mixed vs single dtypes

In [1]: df = DataFrame(dict(A = np.arange(5), B = np.arange(5,10)))

In [2]: df
Out[2]: 
   A  B
0  0  5
1  1  6
2  2  7
3  3  8
4  4  9

In [4]: df.iloc[2:4] = [[10,11],[12,13]]

In [5]: df
Out[5]: 
    A   B
0   0   5
1   1   6
2  10  11
3  12  13
4   4   9
In [6]: df = DataFrame(dict(A = list('abcde'), B = np.arange(5,10)))

In [7]:  df.iloc[2:4] = [['x',11],['y',13]]

In [8]: df
Out[8]: 
    A   B
0   a   5
1   b   6
2   x   y
3  11  13
4   e   9

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated 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