Python中文
首页
教程
问答
标签
搜索
登录
注册
将Python MaskedColumn相乘
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我正在读取一个.html文件中的数据,我要做的就是将data['ra']列乘以15。但是,我得到了一个错误:</p> <pre><code>>>> data = ascii.read("Ldwarf.html", format="html", encoding = "ISO-8859-1") >>> data <Table masked=True length=919> designation ra decl 2MASS J00011217+1535355 0.0200472 +15.593194 2MASS J00025097+2454141 0.0474917 +24.903917 2MASS J00040288-6410358 0.0674667 -64.176611 </code></pre> <p>以及</p> <pre><code>>>> data['ra'] <MaskedColumn name='ra' dtype='str10' length=919> decimal hr 0.0200472 0.0474917 ... 23.9783250 23.9993389 >>> data['ra'] = data['ra'].filled([-9.99]) >>> data['ra'] = data['ra']*15. TypeError: ufunc 'multiply' did not contain a loop with signature matching types dtype('<U32') dtype('<U32') dtype('<U32') </code></pre> <p>怎么回事??你知道吗</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>它说<code>dtype</code>是<code>str10</code>。你知道吗</p> <p>将其转换为64位实数:</p> <pre><code>data['ra'] = data['ra'].astype(numpy.float64) </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
文本导入时标题行中的特殊字符
10 回答
文本小部件:在没有输入时更新并在循环后保持空闲
3 回答
文本小部件tkin
1 回答
文本小部件tkinter中的标签更改或文本外观更改是否有撤消功能?
4 回答
文本小部件tkinter复制图像选项
10 回答
文本小部件上的Python Tkinter ttk滚动条未缩放
3 回答
文本小部件上的滚动条可能需要根据制表符ord显示前进行滚动
10 回答
文本小部件不显示lis中的内容
8 回答
文本小部件不显示Unicode字符
10 回答
文本小部件中写入的行间距
2 回答
文本小部件中的文本作为变量
9 回答
文本小部件中的滚动条仅显示在底部
4 回答
文本小部件中的选项卡键空间计数
3 回答
文本小部件作为Lis
9 回答
文本小部件在主框架中扩展列宽
4 回答
文本小部件未使用删除功能清除
4 回答
文本小部件滚动动画(Tkinter、Python)
1 回答
文本居中。格式正确吗?
2 回答
文本差分算法
7 回答
文本已知时音频文件中的单词索引
7 回答