Skip to content

Same parameter name for specifying column names in pd.read_csv and pd.DataFrame #29771

@regstrtn

Description

@regstrtn

The two most common ways of creating a new dataframe use different parameters for taking a list of column names as input.
In pd.read_csv, the syntax is:
pandas.read_csv(filepath, sep=',', delimiter=None, header='infer', names=None)

In pd.DataFrame, the syntax is:
pandas.DataFrame(data=None, index=None, columns=None)

And then again, in df.to_csv, we use the name columns.
df.to_csv(self, path_or_buf=None, sep=', ', na_rep='', float_format=None, columns=None)

Can they both be changed to columns?

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