当前位置:网站首页>Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
2022-04-23 07:42:00 【异二次元】
错误如下,说明模型不支持Object类型(非数值类型)的数据,所以需要讲Object类型的数据采用独热编码,或者自己进行预编码,代码如下:

import pandas as pd
data=pd.read_csv("test.csv")
for features in data.columns:
if data[features].dtype == 'object':
data[features] = pd.Categorical(data[features]).codes
版权声明
本文为[异二次元]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43694829/article/details/124237102
边栏推荐
- 【学习】从零开始的音视频开发(9)——NuPlayer
- QFileDialog 选择多个文件或文件夹
- Somme numérique de la chaîne de calcul pour un problème simple de leetcode
- An idea plug-in that doesn't work, but can install X
- dmp引擎工作总结(2021,光剑)
- QT reading and writing XML files
- 編譯原理題-帶答案
- idea:使用easyYapi插件导出yapi接口
- 青苹果影视系统源码 影视聚合 影视导航 影视点播网站源码
- colorui 解决底部导航遮挡内容问题
猜你喜欢

利用Js实现一个千分位

监控智能回放是什么,如何使用智能回放查询录像

Kubernetes in browser and IDE | interactive learning platform killercoda

一个必看的微信小程序开发指南1-基础知识了解

CGM optimizes blood glucose monitoring and management -- Yiyu technology appears in Sichuan International Medical Exchange Promotion Association

How to read books and papers

Listed on the Shenzhen Stock Exchange: the market value is 5.2 billion yuan. Lu is the East and his daughter is American

Asan minimalism

QT reading and writing XML files

Goland 调试go使用-大白记录
随机推荐
Detailed explanation of ansible automatic operation and maintenance (I) installation and deployment, parameter use, list management, configuration file parameters and user level ansible operating envi
Asan minimalism
室内定位技术对比
Brief description of CPU
单点登录 SSO
CSV column extract column extraction
[appium] encountered the problem of switching the H5 page embedded in the mobile phone during the test
WordPress love navigation theme 1.1.3 simple atmosphere website navigation source code website navigation source code
Idea: export Yapi interface using easyyapi plug-in
colorui 解决底部导航遮挡内容问题
input元素添加监听事件
Qt读取路径下所有文件或指定类型文件(含递归、判断是否为空、创建路径)
PyQt5开发之QTableWidget表头自定义与美化(附源代码下载)
跨域配置报错: When allowCredentials is true, allowedOrigins cannot contain the special value “*“
synchronized 实现原理
An idea plug-in that doesn't work, but can install X
ELK生产实践
js将树形结构数据转为一维数组数据
[explanation] get ora-12838: cannot read / modify an object after modifying it in parallel
form中enctype属性