Skip to content

loadtxt - add usecols option #962

Open
@rzehumat

Description

@rzehumat

Motivation

Would it be possible to add an option to skip the loading of certain columns when using the loadtxt from subroutine from stdlib_io?

The use case could be for loading tabular files with missing data. For example, loading a file with the table below would with fmt="*" would fail (unless skiprows=4). However, sometimes one would need just to load columns 1-3.

1.00E+00  2.00E+00  3.00E+00  5.00E+00
4.00E+00  5.00E+00  6.00E+00  5.00E+00
7.00E+00  8.00E+00  9.00E+00  5.00E+00
7.00E+00  8.00E+00  9.00E+00  
7.00E+00  8.00E+00  9.00E+00  5.00E+00
7.00E+00  8.00E+00  9.00E+00  5.00E+00

Prior Art

The option would be similar to usecols option in numpy

Additional Information

Other options to treat missing values are possible -- e.g. supplying NaN to missing values or skipping rows or columns with missing data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions