Skip to content

Strip header names? #9067

Closed
Closed
@mrocklin

Description

@mrocklin

In csv files that have odd spacing

name,    amount
Alice,100
Bob,200

Loaded dataframes can sometimes have column names with leading or trailing whitespace. Should these column names be stripped by default?

In [4]: pd.read_csv('foo.csv').columns
Out[4]: Index([u'name', u'    amount'], dtype='object')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions