(类)(int)和负值滞后
我正在构建一个小的加密项目,并尝试了各种方法来对移动量的平均值(以前的行)进行测试,与当前卷(当前行)相比。
我在上面和低于0的案例语句测试中尝试了滞后,因为滞后将负值视为正值。 IE:-2大于-1。
在这里的一个问题的帮助下,我更改了使用的代码(类)(int),但是This Treats -2也大于-1。
lag :(
(case when lag(volume) over (partition by name order by recordid) < volume \
then '1' \
when lag(volume) over (partition by name order by recordid) > volume \
then '0' \
class)(int):
for x in records:
rid = (x[0])
result = int(x[1] > x[2])
data+= [(result, rid)]
我是新手,但仍然很开心。我通过做学习并正在快速学习。 有人有任何建议吗?
希望这个问题有足够的信息,并符合一个好问题的标准。
I am building a little crypto project and have tried various methods to run a test on moving volume average (previous rows) compared to current volume (current row).
I have tried LAG in a case statement testing above and below 0 does not work as LAG treats negative values as positive. Ie: -2 is greater than -1.
With the help of a previous question here I changed the code to use (Class) (Int) however this treats -2 is greater than -1 also.
LAG:
(case when lag(volume) over (partition by name order by recordid) < volume \
then '1' \
when lag(volume) over (partition by name order by recordid) > volume \
then '0' \
(Class) (Int):
for x in records:
rid = (x[0])
result = int(x[1] > x[2])
data+= [(result, rid)]
Im new to this but having fun none the less. I learn by doing and am learning fast.
Does anyone have any suggestions?
Hopefully this Question has sufficient info and meets the criteria for a good question.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这似乎奏效了。
在更改之前,最后一个输入结果是1。
This seems to have worked.
Prior to the change the last entry result would have been 1.