I want to add a new column 'b' to an existing CSR sparse matrix 'X', but the following code is giving error: **ValueError: blocks[0,:] has incompatible row dimensions. Got blocks[0,1].shape[0] == 1**

X = csr_matrix((cellValue, (row, col)), shape=(a.shape[0], a.shape[1]), dtype=np.int8)

>>> X.toarray()

array([[0, 0, 0, 0, 1],

[0, 2, 0, 0, 0],

[0, 0, 0, 3, 0],

[4, 0, 0, 0, 0],

[0, 0, 5, 0, 6],

[0, 0, 7, 0, 0],

[0, 8, 0, 9, 0]], dtype=int8)

#add new column

b=np.array([1,2,3,4,5,6,7])

X = hstack((X,b), format='csr')