def test_vstack(self): numpy = np.array([[1., 2.], [3., 4.]]) csr = sp.csr_matrix(numpy) csc = sp.csc_matrix(numpy) self.assertCorrectArrayType(vstack([numpy, numpy]), shape=(4, 2), sparsity="dense") self.assertCorrectArrayType(vstack([csr, numpy]), shape=(4, 2), sparsity="sparse") self.assertCorrectArrayType(vstack([numpy, csc]), shape=(4, 2), sparsity="sparse") self.assertCorrectArrayType(vstack([csc, csr]), shape=(4, 2), sparsity="sparse")
def test_vstack(self): numpy = np.array([[1., 2.], [3., 4.]]) csr = sp.csr_matrix(numpy) csc = sp.csc_matrix(numpy) self.assertCorrectArrayType( vstack([numpy, numpy]), shape=(4, 2), sparsity="dense") self.assertCorrectArrayType( vstack([csr, numpy]), shape=(4, 2), sparsity="sparse") self.assertCorrectArrayType( vstack([numpy, csc]), shape=(4, 2), sparsity="sparse") self.assertCorrectArrayType( vstack([csc, csr]), shape=(4, 2), sparsity="sparse")