Skip to content

CSV ADRIOs: support named columns #279

Description

@JavadocMD

Currently CSV ADRIOs only support selecting columns by index:

csv.CSVFileN(
    file_path=path_to_my_file,
    dtype=np.int64,
    key_col=1,
    key_type="state_abbrev",
    data_col=2,
    skiprows=1,
)

However it's very common to have column headers, and in this case we could use the string names instead. Much less tedious and error prone, generally, especially when using CSV files with many columns.

Supplying a str value for a column would raise an error if column headers aren't available. Need to think through how to handle some edge-cases, like files with multiple header rows.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions