Skip to content

Issue Using Chained Accessors with Multiple dtypes & Performance Tips #4546

Closed
@dirkbike

Description

@dirkbike

The below code should print 99.9, but instead prints 10.5. This bug goes away if column b in the dataframe is set to all float values instead of int values. I am running Pandas 0.12.0 and Python 2.7.3.

import pandas
df = pandas.DataFrame({'a':[7.3,5.1,3.0,5.5,6.4],'b':[5,4,5,1,6]})
df['a'] = df.apply(lambda x: 10.5, axis=1)
df.iloc[0]['a'] = 99.9
print df.iloc[0]['a']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions