![](/img/trans.png)
[英]What is the Python (numpy or scipy or Pandas) equivalent for R's adjboxStats function?
[英]What is the R equivalent of Python function scipy.sparse.bmat?
特定於我的代碼的特殊解決方案。 Python代碼如下所示:
P = sparse.bmat([[None, W], [F, None]])
其中W和F是兩個稀疏矩陣。 等效的R代碼:
blk1 = Matrix::sparseMatrix(i=1,j=1,x=0,dims=c(nrow(W),ncol(F)))
blk2 = Matrix::sparseMatrix(i=1,j=1,x=0,dims=c(nrow(F),ncol(W)))
P=rbind(cbind(blk1,W),cbind(F,blk2))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.