Skip to content

Series.apply bug when result same length as series #1183

@wesm

Description

@wesm
In [2]: s = pandas.Series([1,2])

In [3]: s
Out[3]: 
0    1
1    2

In [4]: s.apply(lambda x: (x, x+1))
Out[4]: 
0    0    1
1    2
1    0    2
1    3

But:

In [8]: s = pandas.Series([1,2,3])

In [9]: s
Out[9]: 
0    1
1    2
2    3

In [10]: s.apply(lambda x: (x, x+1))
Out[10]: 
0    (1, 2)
1    (2, 3)
2    (3, 4)

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