关注
码龄
粉丝数
原力等级 --
被采纳
被点赞
采纳率
战战兢兢59
2021-11-11 16:50
采纳率: 80%
浏览 1818
首页
开发工具
已结题
请问类型错误TypeError: Cannot interpret '1' as a data type。这是什么原因。
ide
下面是两张对比图。我自己敲得代码就出错误,拿别人的复制过来就没问题。这是什么问题。
收起
写回答
好问题
0
提建议
关注问题
微信扫一扫
点击复制链接
分享
邀请回答
编辑
收藏
删除
收藏
举报
1
条回答
默认
最新
关注
码龄
粉丝数
原力等级 --
被采纳
被点赞
采纳率
mzhan017
2021-11-11 17:59
关注
zero函数调用少一对括号
本回答被题主选为最佳回答
, 对您是否有帮助呢?
本回答被专家选为最佳回答
, 对您是否有帮助呢?
本回答被题主和专家选为最佳回答
, 对您是否有帮助呢?
解决
7
无用
评论
打赏
微信扫一扫
点击复制链接
分享
举报
评论
按下Enter换行,Ctrl+Enter发表内容
查看更多回答(0条)
向“C知道”追问
报告相同问题?
提交
关注问题
Python报错:
TypeError
: Cannot
int
erp
ret ‘1‘ as a
data
type
2022-10-23 14:33
无 眠的博客
我传入的参数是(layers_dims[l],1),这是不对的,因为zeros只需要传入一个参数,就是shape。
TypeError
: Cannot
int
erp
ret ‘4‘ as a
data
type
2022-05-11 15:17
wavehaha的博客
TypeError
: Cannot
int
erp
ret ‘4’ as a
data
type
问题: 在写代码时,self.observations = np.zeros((self.max_size, state_dim),其中self.max_size和state_dim分别是两个参数,结果报错:
TypeError
: Cannot ...
python
错误
:
TypeError
: Cannot
int
erp
ret ‘3‘ as a
data
type
2021-08-15 21:44
cyan_orange的博客
下面
错误
:
错误
:无法将3当作一个数据
类型
,那么我们可以知道肯定是缺少了参数,查看np.ones的参数如下: 改为这样就可以了: c = np.ones((2,3,4))
Python报错:
TypeError
: Cannot
int
erp
ret ‘4‘ as a
data
type
2023-01-01 19:04
sweettea~的博客
Python报错:
TypeError
: Cannot
int
erp
ret ‘4‘ as a
data
type
TypeError
: Cannot
int
erp
ret ‘<attribute ‘d
type
‘ of ‘numpy.generic‘ objects>‘ as a
data
type
2023-01-14 14:45
音九尘的博客
TypeError
: Cannot
int
erp
ret ‘‘d
type
‘ of ‘numpy.generic‘objects>‘as a
data
type
;ModuleNotFoundError: No module named ‘pandas.compat‘
TypeError
: Cannot
int
erp
ret ‘2‘ as a
data
type
2020-10-27 22:45
咖乐布小部的博客
错误
行: 查看ones 定义 所以应该是: b = torch.as_tensor(np,ones((2,3))) 这里省略了d
type
.。
TypeError
: Cannot
int
erp
ret ‘torch.bfloat16‘ as a
data
type
2023-09-11 08:55
joe_q的博客
torch numpy bfloat16
type
error
解决方案
TypeError
: Cannot
int
erp
ret ‘<attribute ‘d
type
‘ of ‘numpy.generic‘ objects>‘ as a
data
type
2024-04-10 00:00
you_are_my_sunshine*的博客
解决方案
TypeError
: Cannot
int
erp
ret ‘‘d
type
‘ of ‘numpy.generic‘ objects>‘ as a
data
type
numpy创建zeros数组时报错
TypeError
: Cannot
int
erp
ret ‘8‘ as a
data
type
2021-08-05 21:35
江南路漫的博客
错误
代码 xPo
int
= np.zeros(pow(2, k), pow(2, k)) 改正方法 zeros括号内填数组行列数时,加一对括号。 正确代码 xPo
int
= np.zeros((pow(2, k), pow(2, k)))
TypeError
: Cannot
int
erp
ret ‘<attribute ‘d
type
‘ of ‘numpy.generic‘ objects>‘ as a
data
type
解决方案
2024-06-07 13:45
windawdaysss的博客
使用pandas中的info()函数时出现如题
错误
。更新了pandas版本后问题解决。
解决:
TypeError
: Cannot
int
erp
ret ‘<attribute ‘d
type
‘ of ‘numpy.generic‘ objects>‘ as a
data
type
2024-04-28 09:03
执沐的博客
错误
发生在尝试创建一个条形图时,具体的
错误
类型
是。列中确实包含了非数值
类型
的数据,你需要进行数据清洗,将这些非数值
类型
的数据转换为数值
类型
或者从数据集中移除。但是我发现的我的数据没啥问题啊,于是我就想...
拒绝访问
TypeError
: Cannot
int
erp
ret ‘<attribute ‘d
type
‘ of ‘numpy.generic‘ objects>‘ as a
data
type
2023-11-20 14:30
热爱生活的五柒的博客
: 'c:\\program
data
\\anaconda3\\lib\\……
TypeError
: Cannot
int
erp
ret ‘‘d
type
‘ of ‘numpy.generic‘ objects>‘ as a
data
type
解决方法: 将目录C:\Program
Data
\Anaconda3这个文件夹的属性中user用户的...
python报错:
TypeError
: Cannot
int
erp
ret ‘<attribute ‘d
type
‘ of ‘numpy.generic‘objects>‘as a
data
type
2021-10-31 04:19
202xxx的博客
原因
:pandas和matplotlib版本不匹配 ...#方案1:conda更新一下所有包 conda update -n base conda #方案2:pip 更新最新版pandas pip install pandas --upgrade #方案3:conda更新pandas conda install pandas
如何解决
TypeError
: Cannot
int
erp
ret ‘<attribute ‘d
type
‘ of ‘numpy.generic‘objects>‘as a
data
type
2022-04-02 18:54
Unacandoit的博客
在使用df.info()时报错:
TypeError
: Cannot
int
erp
ret ‘‘d
type
‘ of ‘numpy.generic‘objects>‘as a
data
type
2.查资料 在网页上搜索了几种方法,总结如下: (1)更新numpy, pandas: pip install -U numpy ...
没有解决我的问题,
去提问
向专家提问
向AI提问
付费问答(悬赏)服务下线公告
◇ 用户帮助中心
◇ 新手如何提问
◇ 奖惩公告
问题事件
关注
码龄
粉丝数
原力等级 --
被采纳
被点赞
采纳率
系统已结题
11月19日
关注
码龄
粉丝数
原力等级 --
被采纳
被点赞
采纳率
已采纳回答
11月11日
关注
码龄
粉丝数
原力等级 --
被采纳
被点赞
采纳率
创建了问题
11月11日