Skip to content

iterrows changes dtype of columns #3566

Closed
@tebeka

Description

@tebeka
In [105]: df = pd.DataFrame([[1, 1.0]], columns=['x', 'y'])
In [112]: row = next(df.iterrows())[1]
In [113]: row
Out[113]: 
x    1
y    1
Name: 0, dtype: float64
In [114]: row['x'].dtype
Out[114]: dtype('float64')
In [115]: df['x'].dtype
Out[115]: dtype('int64')

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