无法使用类型对象Dask执行STD
在DASK上执行正常计算给我错误的
x_std = x.std().compute()
计算头:
x.head()
LocalTime Ask Bid
0 2004.10.25 00:01:01.975 86.837 86.877
1 2004.10.25 00:01:19.300 86.791 86.891
2 2004.10.25 00:01:30.759 86.812 86.842
3 2004.10.25 00:01:41.798 86.801 86.831
4 2004.10.25 00:01:42.213 86.794 86.824
错误:
TypeError: cannot perform std with type object
我是按照文档进行的...
performing normal calculation on dask is giving me the error
x_std = x.std().compute()
Computing head:
x.head()
LocalTime Ask Bid
0 2004.10.25 00:01:01.975 86.837 86.877
1 2004.10.25 00:01:19.300 86.791 86.891
2 2004.10.25 00:01:30.759 86.812 86.842
3 2004.10.25 00:01:41.798 86.801 86.831
4 2004.10.25 00:01:42.213 86.794 86.824
Error :
TypeError: cannot perform std with type object
I was doing in accordance with documentation ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从
x.head()
的输出中,可以看出其中一列是DateTime列,但是没有转换,它可能被存储为>“ object”
列。要检查dtypes,请运行:要转换,使用此博客文章:
如果其他两个列(询问和投标)也是对象,则需要另一种转换为数字(请参见此博客文章有关详细信息):
转换后,
ddf_std = ddf.std()。compute()
应无错误地工作。From the output of
x.head()
, it can be seen that one of the columns is a datetime column, however without conversion, it's likely stored as anobject
column. To check dtypes, run:To convert, use
dd.to_datetime
as explained in this blog post:If the other two columns, Ask and Bid, are also objects, then another conversion, to numeric, is needed (see this blog post for details):
After conversion, the
ddf_std = ddf.std().compute()
should work without error.