Skip to content

read_fwf does not take into account skiprows when inferring column width #11256

Closed
@xchardon

Description

@xchardon

read_fwf can automatically detect column widths, but that does not seem to take into account rows to be skipped (parameter skiprows).
So, if the file contains text before the data, column detection fails. It could be solved by using only the actual data lines (and header) to infer column widths.
I worked around that issue by opening the text file, calling readline as many times as necessary (= skiprows), and then calling read_fwf on that buffer (with skiprows=0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions