[bug] "TypeError: read_feather() got an unexpected keyword argument 'nthreads'"

4 篇文章 0 订阅

when running this cell

pd.read_feather('tmp/bulldozers-raw')

I got this 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'

In this post, someone suggested it’s because of pandas version lower than 0.21 as n_threads was added after that version according to the documentation.

Signature: pd.read_feather(path, nthreads=1)
Docstring:
Load a feather-format object from the file path

.. versionadded 0.20.0

Parameters
----------
path : string file path, or file-like object
nthreads : int, default 1
    Number of CPU threads to use when reading to pandas.DataFrame

   .. versionadded 0.21.0

Returns
-------

But I got pandas version 0.23.4, so that didn’t work for me.
Other answers suggested replacing the broken line with

import feather
df_raw = feather.read_dataframe('tmp/bulldozers-raw')

That worked for me.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值