admin管理员组文章数量:1292459
For example, I have two matrices, indclass and vwap, and I want to apply a function to corresponding rows from both matrices. The current approach fixes indclass to the first row, which is not what I want:
`byRow(contextby{demean, , indclass.row(0)}, vwap)
For example, I have two matrices, indclass and vwap, and I want to apply a function to corresponding rows from both matrices. The current approach fixes indclass to the first row, which is not what I want:
`byRow(contextby{demean, , indclass.row(0)}, vwap)
Share
edited Feb 13 at 8:59
DarkBee
15.6k8 gold badges72 silver badges116 bronze badges
asked Feb 13 at 8:58
HTLHTL
11
1 Answer
Reset to default 0To realize row-by-row operation of two matrices in DolphinDB, you need to bind the data of the corresponding rows dynamically through the high-level function each
or byRow
.
try this code:
def processRow(indRow, vwapRow) {
return contextby(indRow, demean(vwapRow))
}
result = each(processRow, indclass.{row}, vwap.{row})
本文标签: distributed computingHow to Perform Rowwise Operations on Two MatricesStack Overflow
版权声明:本文标题:distributed computing - How to Perform Row-wise Operations on Two Matrices? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741553575a2385020.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论