Skip to content

Optional arguments for loadtxt #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Beliavsky opened this issue Sep 4, 2021 · 1 comment · Fixed by #652
Closed

Optional arguments for loadtxt #512

Beliavsky opened this issue Sep 4, 2021 · 1 comment · Fixed by #652
Labels
API Discussion on a specific API for a proposal (exploratory) in progress This proposal is being worked on topic: IO Common input/output related features

Comments

@Beliavsky
Copy link

Beliavsky commented Sep 4, 2021

Loadtxt reads an array, which will typically represent data. Often a data file will have have column labels on the first line. I suggest adding an optional nskip_lines argument so that loadtxt can handle such a file by calling it with nskip_lines = 1. One could also add an optional col_labels(:) character array argument, such that
size(col_labels) == size(d,2). Adding these features would allow loadtxt to handle a wider range of data files that people have and give it some of the functionality of read.table() in R. The functions to read data frames in R and Python pandas allow columns to be of different types, which I do not expect loadtxt to handle.

To speed up a program during development one may read only a subset of the data. To accommodate this optional arguments max_rows and max_col could be added. Read.table() in R has an nrows argument, the maximum number of rows to read in.

@awvwgk awvwgk added API Discussion on a specific API for a proposal (exploratory) topic: IO Common input/output related features labels Sep 18, 2021
@MuellerSeb
Copy link
Contributor

See #652 for the skiprows feature.

@awvwgk awvwgk linked a pull request Apr 19, 2022 that will close this issue
@14NGiestas 14NGiestas added the in progress This proposal is being worked on label May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Discussion on a specific API for a proposal (exploratory) in progress This proposal is being worked on topic: IO Common input/output related features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants