'Remove nans from sparse matrix.
GH-2295
GH-2178'

def test_sparse_nans(self):

    m = sp.csr_matrix(np.ones((3, 3)))
    m[0, :] = np.nan
    self.assertTrue(np.isnan(m.data).any())
    preprocess.ReplaceUnknowns(None, value=42.0).transform(m)
    self.assertFalse(np.isnan(m.data).any())
