Read_feather() function error


(Alhamede Abdelgadir) #1

I tried running the below code

pd.read_feather('/home/hamede/fastai/data/tmp/bulldozers-raw')

I get the below error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-83-11476d87a470> in <module>()
----> 1 pd.read_feather('/home/hamede/fastai/data/tmp/bulldozers-raw')

~/anaconda3/envs/fastai/lib/python3.6/site-packages/pandas/io/feather_format.py in read_feather(path, nthreads)
    110         return feather.read_dataframe(path)
    111 
--> 112     return feather.read_dataframe(path, nthreads=nthreads)

TypeError: read_feather() got an unexpected keyword argument 'nthreads'

I tried reinstallting feather-format using pip even tried it using conda but I still get the same error


(Marc Rostock) #2

because it says “unexpected argument” it is pretty likely that you have a too old version of pandas installed. This argument was added only in version 0.21.

you can check your pandas version in the jupyter notebook using:

pd.__version__

(Alhamede Abdelgadir) #3

Hey ! Thanks a lot it fixed my issue.


#4

I faced the same error, but it persisted even after I upgraded pandas. A brief search uncovered this github report, indicating that pyarrow 0.11.0 may be the culprit. So, if upgrading pandas does not work, try
!{sys.executable} -m pip install pyarrow==0.10.0

After downgrading pyarrow, my Jupyter notebook could read the feather format again.


(Will) #5

I’m having the same issue. Still broken for me. Pandas version 23.4 and i’ve tried pyarrow 0.11.0, pyarrow 0.10.0 and pyarrow 0.09.0

update: working config pandas 0.23.0 and pyarrow 0.09


(Vaibhav) #6

Suggesting a workaround:
line to be replaced in the notebook: pd.read_feather(’/home/hamede/fastai/data/tmp/bulldozers-raw’)
replacement lines:
import feather
feather.read_dataframe(’/home/hamede/fastai/data/tmp/bulldozers-raw’)


#7

Thanks for this! Workaround did the trick for me without needing to mess around with different versions of packages.