@@ -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
4342When you use :func: `numpy.array ` to define a new array, you should
4443consider the :doc: `dtype <basics.types >` of the elements in the array,
@@ -173,11 +172,11 @@ list or tuple,
173172routine 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
280279In 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
291290For 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. ],
0 commit comments