Skip to content

Use converters for all columns #9291

Closed
Closed
@terriyu

Description

@terriyu

Suggestion for an enhancement: loadtxt() and genfromtxt() have the option to specify converters but only on a per-column basis. If you have many columns and want to use the same converter on all of them, it would be nice to be able to do that without having to create a giant dictionary containing the same converting function over and over again.

So instead of having

np.loadtxt('myfile', converters={0: myfunc, 1: myfunc, 2: myfunc, 3: myfunc, 4: myfunc, 5: myfunc, 6: myfunc, 7: myfunc, 8: myfunc, 9: myfunc})

it would be nice to use something like

np.loadtxt('myfile', converters=myfunc)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions