@@ -489,7 +489,11 @@ def inplace_csr_row_normalize_l1(X):
489
489
--------
490
490
>>> from scipy.sparse import csr_matrix
491
491
>>> from sklearn.utils.sparsefuncs_fast import inplace_csr_row_normalize_l1
492
- >>> X = csr_matrix(([1.0, 2.0, 3.0], [0, 2, 3], [0, 3, 4]), shape=(3, 4))
492
+ >>> import numpy as np
493
+ >>> indptr = np.array([0, 2, 3, 4])
494
+ >>> indices = np.array([0, 1, 2, 3])
495
+ >>> data = np.array([1.0, 2.0, 3.0, 4.0])
496
+ >>> X = csr_matrix((data, indices, indptr), shape=(3, 4))
493
497
>>> X.toarray()
494
498
array([[1., 2., 0., 0.],
495
499
[0., 0., 3., 0.],
@@ -547,7 +551,11 @@ def inplace_csr_row_normalize_l2(X):
547
551
--------
548
552
>>> from scipy.sparse import csr_matrix
549
553
>>> from sklearn.utils.sparsefuncs_fast import inplace_csr_row_normalize_l2
550
- >>> X = csr_matrix(([1.0, 2.0, 3.0], [0, 2, 3], [0, 3, 4]), shape=(3, 4))
554
+ >>> import numpy as np
555
+ >>> indptr = np.array([0, 2, 3, 4])
556
+ >>> indices = np.array([0, 1, 2, 3])
557
+ >>> data = np.array([1.0, 2.0, 3.0, 4.0])
558
+ >>> X = csr_matrix((data, indices, indptr), shape=(3, 4))
551
559
>>> X.toarray()
552
560
array([[1., 2., 0., 0.],
553
561
[0., 0., 3., 0.],
0 commit comments