Reputation: 1
I want to read a large file in jupyter notebook. (can not read using pandas becuase of the memory constraints). The datafile requres over 35 GB memory but my space has only 20 GB. Therefore, I tried to use modin panda instead but occured error.
FactoryDispatcher.read_sas() takes 1 positional argument but 2 were given
## Reading sas7bdat
import modin.pandas as pd
import numpy as np
cabd_2021 = pd.read_sas(
'/xxx/xxx/xxx/xxxx/xxx/xxxx_010121.sas7bdat',
format = "sas7bdat",
encoding="latin-1"
)
cabd
Returns ERROR
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[9], line 3
1 ## Les datafil fra SAS
----> 3 cabd= pd.read_sas()
File ~/jxxxxxxxxxxxxxxxxxxxxx/.venv/lib/python3.10/site-packages/modin/logging/logger_decorator.py:128, in enable_logging.<locals>.decorator.<locals>.run_and_log(*args, **kwargs)
113 """
114 Compute function with logging if Modin logging is enabled.
115
(...)
125 Any
126 """
127 if LogMode.get() == "disable":
--> 128 return obj(*args, **kwargs)
130 logger = get_logger()
131 logger_level = getattr(logger, log_level)
File ~/xxxxxxxxxxxxxxxxxxxxxxxxx/.venv/lib/python3.10/site-packages/modin/pandas/io.py:581, in read_sas(filepath_or_buffer, format, index, encoding, chunksize, iterator, compression)
577 Engine.subscribe(_update_engine)
578 from modin.core.execution.dispatching.factories.dispatcher import FactoryDispatcher
580 return DataFrame(
--> 581 query_compiler=FactoryDispatcher.read_sas(
582 filepath_or_buffer,
583 format=format,
584 index=index,
585 encoding=encoding,
586 chunksize=chunksize,
587 iterator=iterator,
588 compression=compression,
589 )
590 )
TypeError: FactoryDispatcher.read_sas() takes 1 positional argument but 2 were given
Upvotes: 0
Views: 111
Reputation: 176
This is a Modin bug that was fixed in a pull request that has not made it into a release yet. You can install the latest version of Modin to get the fix, or you can wait for the next patch release of Modin. If you can't change your Modin version, you can read the dataframe into pandas with pandas.read_sas
, then construct a Modin dataframe out of the resulting pandas dataframe.
Upvotes: 0