Skip to content

Hope genfromtxt function add nrows keyword #5084

Closed

Description

@syrte

numpy function genfromtxt can skip header and footer lines. However sometimes we might want to control the number of rows to read directly. For example, a txt file might contain several blocks with different number of columns, we can't read them all in once. Specify nrow to read would be convenient.

Is it possible add something like
genfromtxt(file,skip_header=1,nrows=2) ?

Activity

  1. njsmith commented on Sep 19, 2014

    @njsmith
    Member

    Seems like a reasonable convenience feature to me. Want to have a go at
    implementing it? We like pull requests :-)
    On 19 Sep 2014 10:20, "styr" [email protected] wrote:

    numpy function genfromtxt can skip header and footer lines. However
    sometimes we might want to control the number of rows to read directly. For
    example, a txt file might contain several blocks with different number of
    columns, we can't read them all in once. Specify nrow to read would be
    convenient.

    Is it possible add something like
    genfromtxt(file,skip_header=1,nrows=2) ?

    —
    Reply to this email directly or view it on GitHub
    #5084.

  2. syrte commented on Sep 21, 2014

    @syrte
    ContributorAuthor

    @njsmith Thanks for your suggestion.
    I've proposed my first pull request :-)

  3. added a commit that references this issue on Jan 24, 2015
    0091499
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions