Skip to content

ExcelFile.parse() does not return TextFileReader object, but rather a DataFrame #8011

Closed
@rkyleg

Description

@rkyleg

When specifying a chunksize during the ExcelFile.parse() method, I should be back an iterable object, but instead a DataFrame is returned.

If you return just the TextParser (change parser.read() to just parser) in the code block below, then iterating over the parsed ExcelFile works and returns the specified number of chunks.

The code block is taken from pandas.io.excel.py line 334

Hopefully I didn't make that confusing.

parser = TextParser(data, header=header, index_col=index_col,
                            has_index_names=has_index_names,
                            na_values=na_values,
                            thousands=thousands,
                            parse_dates=parse_dates,
                            date_parser=date_parser,
                            skiprows=skiprows,
                            skip_footer=skip_footer,
                            chunksize=chunksize,
                            **kwds)
return parser.read()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions