Skip to content

Commit ed91479

Browse files
committed
DOC:Fixed refguide errors for basics.creation.rst
1 parent df0b1bd commit ed91479

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

doc/source/user/basics.creation.rst

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ respectively. Lists and tuples can define ndarray creation:
3737

3838
>>> a1D = np.array([1, 2, 3, 4])
3939
>>> a2D = np.array([[1, 2], [3, 4]])
40-
>>> a3D = np.array([[[1, 2], [3, 4]],
41-
[[5, 6], [7, 8]]])
40+
>>> a3D = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])
4241

4342
When you use :func:`numpy.array` to define a new array, you should
4443
consider the :doc:`dtype <basics.types>` of the elements in the array,
@@ -173,11 +172,11 @@ list or tuple,
173172
routine is helpful in generating linear least squares models, as such::
174173
175174
>>> np.vander(np.linspace(0, 2, 5), 2)
176-
array([[0. , 0. , 1. ],
177-
[0.25, 0.5 , 1. ],
178-
[1. , 1. , 1. ],
179-
[2.25, 1.5 , 1. ],
180-
[4. , 2. , 1. ]])
175+
array([[0. , 1. ],
176+
[0.5, 1. ],
177+
[1. , 1. ],
178+
[1.5, 1. ],
179+
[2. , 1. ]])
181180
>>> np.vander([1, 2, 3, 4], 2)
182181
array([[1, 1],
183182
[2, 1],
@@ -208,7 +207,7 @@ specified shape. The default dtype is ``float64``::
208207
array([[[0., 0.],
209208
[0., 0.],
210209
[0., 0.]],
211-
210+
<BLANKLINE>
212211
[[0., 0.],
213212
[0., 0.],
214213
[0., 0.]]])
@@ -223,7 +222,7 @@ specified shape. The default dtype is ``float64``::
223222
array([[[1., 1.],
224223
[1., 1.],
225224
[1., 1.]],
226-
225+
<BLANKLINE>
227226
[[1., 1.],
228227
[1., 1.],
229228
[1., 1.]]])
@@ -275,7 +274,7 @@ following example::
275274
>>> b = a[:2]
276275
>>> b += 1
277276
>>> print('a =', a, '; b =', b)
278-
a = [2 3 3 4 5 6]; b = [2 3]
277+
a = [2 3 3 4 5 6] ; b = [2 3]
279278

280279
In this example, you did not create a new array. You created a variable,
281280
``b`` that viewed the first 2 elements of ``a``. When you added 1 to ``b`` you
@@ -286,7 +285,7 @@ would get the same result by adding 1 to ``a[:2]``. If you want to create a
286285
>>> b = a[:2].copy()
287286
>>> b += 1
288287
>>> print('a = ', a, 'b = ', b)
289-
a = [1 2 3 4 5 6] b = [2 3]
288+
a = [1 2 3 4] b = [2 3]
290289

291290
For more information and examples look at :ref:`Copies and Views
292291
<quickstart.copies-and-views>`.
@@ -299,8 +298,7 @@ arrays into a 4-by-4 array using ``block``::
299298
>>> B = np.eye(2, 2)
300299
>>> C = np.zeros((2, 2))
301300
>>> D = np.diag((-3, -4))
302-
>>> np.block([[A, B],
303-
[C, D]])
301+
>>> np.block([[A, B], [C, D]])
304302
array([[ 1., 1., 1., 0. ],
305303
[ 1., 1., 0., 1. ],
306304
[ 0., 0., -3., 0. ],

tools/refguide_check.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@
125125
# See PR 17222, these should be fixed
126126
'basics.broadcasting.rst',
127127
'basics.byteswapping.rst',
128-
'basics.creation.rst',
129128
'basics.dispatch.rst',
130129
'basics.indexing.rst',
131130
'basics.subclassing.rst',

0 commit comments

Comments
 (0)