python报错 unexpected keyword argument ‘categories‘
错误:
TypeError: astype() got an unexpected keyword argument 'categories'
或者:
TypeError: __init__() got an unexpected keyword argument 'indices'
错误分析:
类型错误:得到意外的关键字参数“categories”
解决方法:
先尝试把多余的参数去掉,如果不行就升级函数包(版本有关)
其他说明:
astype()方法通常用于将Pandas对象转换为指定的dtype.astype()函数
DataFrame.astype(dtype, copy=True, errors='raise', **kwargs)
参数:
dtype : 数据类型或列名称 - >数据类型,使用numpy.dtype或Python类型,将整个pandas对象强制转换为相同的类型。或者,使用{col:dtype,...},其中col是列标签,dtype是numpy.dtype或Python类型,用于将一个或多个DataFrame列转换为特定于列的类型。
copy : bool,默认为True。返回副本时copy=True(设置copy=False为更改值时要非常小心,然后可能会传播到其他pandas对象)。
errors : {‘raise’, ‘ignore’},默认‘raise’控制提供dtype的无效数据的异常。
raise :允许引发异常
ignore:抑制异常。出错时返回原始对象版本0.20.0中的新功能。
kwargs : 传递给构造函数的关键字参数。返回:casted: 与调用者类型相同
python报错 unexpected keyword argument ‘categories‘相关推荐
- python出错 unexpected keyword argument 'categories'
python出错 unexpected keyword argument 'categories' 解决办法 首先卸载scikit-learn 下载scikit-learn 新版 安装scikit-l ...
- python 报错:positional argument follows keyword argument
SyntaxError: positional argument follows keyword argument 语法错误:位置参数跟在关键字参数后面 错误示例 def sub(a, b):retu ...
- Celery 启动报错 can_read() got an unexpected keyword argument timeout
问题: Celery 启动报错 can_read() got an unexpected keyword argument timeout 方案:更改redis版本和celery版本,我使用下面的ce ...
- 安装报错:TypeError: _classify_installed_files() got an unexpected keyword argument ‘cmake_install_dir‘
服务器内安装opencv-python,压缩包解压,python setup.py install,出现报错. Traceback (most recent call last):File " ...
- 使用scrapy报错:attrs() got an unexpected keyword argument 'eq'解决办法
使用scrapy的时候报错attrs() got an unexpected keyword argument 'eq',在百度和bing上面找了一圈没找到解决方法,最后在谷歌上找到了,出现这个问题的 ...
- 启动django报错:TypeError: __init__() got an unexpected keyword argument ‘providing_args‘
问题一:django跨域 现象: has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present ...
- 【python debug】could not convert string to float: ‘File‘ got an unexpected keyword argument
python debug过程中碰到的问题随手记录 报错1:ValueError: could not convert string to float: 'File' 在网上没有搜到直接匹配的答案 分析 ...
- flask_sqlalchemy连接Mysql报TypeError: create_engine() got an unexpected keyword argument 'encoding'解决办法
最近在使用flask_sqlalchemy连接mysql,但是遇到一个很奇葩的问题,代码如下: #-*-coding:utf-8 -*-from flask_sqlalchemy import SQL ...
- 成功解决python\ops\seq2seq.py TypeError: ms_error() got an unexpected keyword argument 'logits'
成功解决python\ops\seq2seq.py TypeError: ms_error() got an unexpected keyword argument 'logits' 目录 解决问题 ...
- 成功解决python\ops\seq2seq.py TypeError: ms_error() got an unexpected keyword argument 'labels'
成功解决python\ops\seq2seq.py TypeError: ms_error() got an unexpected keyword argument 'labels' 目录 解决问题 ...
最新文章
- java.lang.NoSuchMethodError: No virtual method placeholder(I)Lcom/bumptech/
- 推荐系统+覆盖率(coverage)
- MySQL中只会count(),sum()?累加运算没听过?
- python视频教程从入门到精通全集-零基础小白python从入门到精通视频(全60集)...
- xmake 新站发布:xmake.io
- python中英文半角还是全角_Python3全角转半角的方法
- 华为nova 7 se鸿蒙,荣耀v40和华为Nova7Pro哪个好-参数对比-更值得入手
- 使用electron-vue创建项目卡顿的问题
- MySQL8怎么设置时区为东八区_mysql时区设置为东八区
- linux命令mov,汇编指令_Y-linuz-linux-w_新浪博客
- Fiddler操作技巧
- 有序表的最小和(element)
- linux下抓取网页快照
- 2011戴尔计算机配置,机型与配置(一)
- Tesseract OCR 语言包下载
- 解决CSDN上传资源出现报错:“该资源已存在,请重新上传”
- xml文件中空格输入
- 日常开发用到的谷歌浏览器插件
- 超感猎杀/超感八人组第一季至二季/全集Sense8迅雷下载
- C++虚函数实现机制