Exemplo n.º 1
0
def read_fwf(filepath_or_buffer,
             colspecs="infer",
             widths=None,
             infer_nrows=100,
             **kwds):
    _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
    return DataFrame(query_compiler=BaseFactory.read_fwf(**kwargs))
Exemplo n.º 2
0
def read_fwf(filepath_or_buffer: Union[str, pathlib.Path, IO[AnyStr]],
             colspecs="infer",
             widths=None,
             infer_nrows=100,
             **kwds):
    _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
    kwargs.update(kwargs.pop("kwds", {}))
    return DataFrame(query_compiler=BaseFactory.read_fwf(**kwargs))
Exemplo n.º 3
0
def read_fwf(
    filepath_or_buffer: Union[str, pathlib.Path, IO[AnyStr]],
    colspecs="infer",
    widths=None,
    infer_nrows=100,
    **kwds,
):
    from modin.data_management.factories import BaseFactory

    _, _, _, kwargs = inspect.getargvalues(inspect.currentframe())
    kwargs.update(kwargs.pop("kwds", {}))
    pd_obj = BaseFactory.read_fwf(**kwargs)
    # When `read_fwf` returns a TextFileReader object for iterating through
    if isinstance(pd_obj, pandas.io.parsers.TextFileReader):
        reader = pd_obj.read
        pd_obj.read = lambda *args, **kwargs: DataFrame(query_compiler=reader(
            *args, **kwargs))
        return pd_obj
    return DataFrame(query_compiler=pd_obj)