2

I am looking to take (non-sparse example):

[1 1 1
 1 1 1
 1 1 1]

[2 2 2
 2 2 2
 2 2 2]

And get

[1 1 1
 1 1 1
 1 1 1
 2 2 2
 2 2 2
 2 2 2]

I think this is called a concatenation? I am using csr_matrix.

2
  • 1
    Possible duplicate of Python how to combine two matrices in numpy Commented Oct 22, 2019 at 21:40
  • 2
    For numpy arrays there's np.concatenate and a group of 'stack' functions that use it. For sparse, there's sparse.vstack and sparse.hstack. Both use the spare bmat operation, which combines the the coo attributes of the matrices. Commented Oct 22, 2019 at 22:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.