Skip to content

Commit b5c7bf9

Browse files
committed
str fixes and typos in DIA format
1 parent 6402dcc commit b5c7bf9

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

advanced/scipy_sparse/dia_array.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Examples
4343
>>> mtx = sp.sparse.dia_array((data, offsets), shape=(4, 4))
4444
>>> mtx
4545
<DIAgonal sparse array of dtype 'int64'
46-
with 9 stored elements and shape (4, 4)>
46+
with 9 stored elements (3 diagonals) and shape (4, 4)>
4747
>>> mtx.toarray()
4848
array([[1, 0, 3, 0],
4949
[1, 2, 0, 4],
@@ -63,15 +63,18 @@ Examples
6363
>>> mtx.offsets
6464
array([ 0, -1, 2], dtype=int32)
6565
>>> print(mtx)
66-
(np.int32(0), np.int32(0)) 1
67-
(np.int32(1), np.int32(1)) 2
68-
(np.int32(2), np.int32(2)) 3
69-
(np.int32(3), np.int32(3)) 4
70-
(np.int32(1), np.int32(0)) 5
71-
(np.int32(2), np.int32(1)) 6
72-
(np.int32(3), np.int32(2)) 7
73-
(np.int32(0), np.int32(2)) 11
74-
(np.int32(1), np.int32(3)) 12
66+
<DIAgonal sparse array of dtype 'int64'
67+
with 9 stored elements (3 diagonals) and shape (4, 4)>
68+
Coords Values
69+
(0, 0) 1
70+
(1, 1) 2
71+
(2, 2) 3
72+
(3, 3) 4
73+
(1, 0) 5
74+
(2, 1) 6
75+
(3, 2) 7
76+
(0, 2) 11
77+
(1, 3) 12
7578
>>> mtx.toarray()
7679
array([[ 1, 0, 11, 0],
7780
[ 5, 2, 0, 12],

advanced/scipy_sparse/dok_array.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Examples
4646
* slicing and indexing::
4747

4848
>>> mtx[1, 1]
49-
np.float64(0.0)
49+
0.0
5050
>>> mtx[[1], 1:3]
5151
<Dictionary Of Keys sparse array of dtype 'float64'
5252
with 1 stored elements and shape (1, 2)>

advanced/scipy_sparse/lil_array.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Examples
4242
<List of Lists sparse array of dtype 'float64'
4343
with 3 stored elements and shape (4, 5)>
4444
>>> print(mtx)
45+
<List of Lists sparse array of dtype 'float64'
46+
with 3 stored elements and shape (4, 5)>
47+
Coords Values
4548
(0, 1) 1.0
4649
(0, 3) 1.0
4750
(1, 3) 1.0
@@ -64,6 +67,9 @@ Examples
6467
[3, 0, 1, 0],
6568
[1, 0, 0, 1]]...)
6669
>>> print(mtx)
70+
<List of Lists sparse array of dtype 'int64'
71+
with 6 stored elements and shape (3, 4)>
72+
Coords Values
6773
(0, 1) 1
6874
(0, 2) 2
6975
(1, 0) 3

0 commit comments

Comments
 (0)