@@ -0,0 +1,812 @@
1+diff --git a/src/doc/en/faq/faq-usage.rst b/src/doc/en/faq/faq-usage.rst
2+index 79b4205fd3..9a89bd2136 100644
3+--- a/src/doc/en/faq/faq-usage.rst
4++++ b/src/doc/en/faq/faq-usage.rst
5+@@ -338,7 +338,7 @@ ints. For example::
6+ sage: RealNumber = float; Integer = int
7+ sage: from scipy import stats
8+ sage: stats.ttest_ind(list([1,2,3,4,5]),list([2,3,4,5,.6]))
9+- Ttest_indResult(statistic=0.076752955645333687, pvalue=0.94070490247380478)
10++ Ttest_indResult(statistic=0.0767529..., pvalue=0.940704...)
11+ sage: stats.uniform(0,15).ppf([0.5,0.7])
12+ array([ 7.5, 10.5])
13+
14+diff --git a/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst b/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
15+index 314811c42b..e5f54ec4c2 100644
16+--- a/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
17++++ b/src/doc/en/thematic_tutorials/numerical_sage/cvxopt.rst
18+@@ -48,11 +48,13 @@ we could do the following.
19+ sage: B = numpy.array([1.0]*5)
20+ sage: B.shape=(5,1)
21+ sage: print(B)
22+- [[ 1.]
23+- [ 1.]
24+- [ 1.]
25+- [ 1.]
26+- [ 1.]]
27++ [[1.]
28++ [1.]
29++ [1.]
30++ [1.]
31++ [1.]]
32++
33++
34+ sage: print(A)
35+ [ 2.00e+00 3.00e+00 0 0 0 ]
36+ [ 3.00e+00 0 4.00e+00 0 6.00e+00]
37+diff --git a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
38+index 5b89cd75ee..e50b2ea5d4 100644
39+--- a/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
40++++ b/src/doc/en/thematic_tutorials/numerical_sage/numpy.rst
41+@@ -84,7 +84,7 @@ well as take slices
42+ sage: l[3]
43+ 3.0
44+ sage: l[3:6]
45+- array([ 3., 4., 5.])
46++ array([3., 4., 5.])
47+
48+ You can do basic arithmetic operations
49+
50+@@ -147,11 +147,11 @@ also do matrix vector multiplication, and matrix addition
51+ sage: n = numpy.matrix([[1,2],[3,4]],dtype=float)
52+ sage: v = numpy.array([[1],[2]],dtype=float)
53+ sage: n*v
54+- matrix([[ 5.],
55+- [ 11.]])
56++ matrix([[ 5.],
57++ [11.]])
58+ sage: n+n
59+- matrix([[ 2., 4.],
60+- [ 6., 8.]])
61++ matrix([[2., 4.],
62++ [6., 8.]])
63+
64+ If ``n`` was created with :meth:`numpy.array`, then to do matrix vector
65+ multiplication, you would use ``numpy.dot(n,v)``.
66+@@ -170,11 +170,11 @@ to manipulate
67+ 22., 23., 24.])
68+ sage: n.shape=(5,5)
69+ sage: n
70+- array([[ 0., 1., 2., 3., 4.],
71+- [ 5., 6., 7., 8., 9.],
72+- [ 10., 11., 12., 13., 14.],
73+- [ 15., 16., 17., 18., 19.],
74+- [ 20., 21., 22., 23., 24.]])
75++ array([[ 0., 1., 2., 3., 4.],
76++ [ 5., 6., 7., 8., 9.],
77++ [10., 11., 12., 13., 14.],
78++ [15., 16., 17., 18., 19.],
79++ [20., 21., 22., 23., 24.]])
80+
81+ This changes the one-dimensional array into a `5\times 5` array.
82+
83+@@ -187,8 +187,8 @@ NumPy arrays can be sliced as well
84+ sage: n=numpy.array(range(25),dtype=float)
85+ sage: n.shape=(5,5)
86+ sage: n[2:4,1:3]
87+- array([[ 11., 12.],
88+- [ 16., 17.]])
89++ array([[11., 12.],
90++ [16., 17.]])
91+
92+ It is important to note that the sliced matrices are references to
93+ the original
94+@@ -224,8 +224,8 @@ Some particularly useful commands are
95+
96+ sage: x=numpy.arange(0,2,.1,dtype=float)
97+ sage: x
98+- array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. ,
99+- 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])
100++ array([0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2,
101++ 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9])
102+
103+ You can see that :meth:`numpy.arange` creates an array of floats increasing by 0.1
104+ from 0 to 2. There is a useful command :meth:`numpy.r_` that is best explained by example
105+@@ -240,10 +240,11 @@ from 0 to 2. There is a useful command :meth:`numpy.r_` that is best explained b
106+ sage: Integer=int
107+ sage: n=r_[0.0:5.0]
108+ sage: n
109+- array([ 0., 1., 2., 3., 4.])
110++ array([0., 1., 2., 3., 4.])
111+ sage: n=r_[0.0:5.0, [0.0]*5]
112+ sage: n
113+- array([ 0., 1., 2., 3., 4., 0., 0., 0., 0., 0.])
114++ array([0., 1., 2., 3., 4., 0., 0., 0., 0., 0.])
115++
116+
117+ :meth:`numpy.r_` provides a shorthand for constructing NumPy arrays efficiently.
118+ Note in the above ``0.0:5.0`` was shorthand for ``0.0, 1.0, 2.0, 3.0, 4.0``.
119+@@ -255,7 +256,7 @@ intervals. We can do this as follows
120+ ::
121+
122+ sage: r_[0.0:5.0:11*j]
123+- array([ 0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5, 5. ])
124++ array([0. , 0.5, 1. , 1.5, 2. , 2.5, 3. , 3.5, 4. , 4.5, 5. ])
125+
126+ The notation ``0.0:5.0:11*j`` expands to a list of 11 equally space
127+ points between 0 and 5 including both endpoints. Note that ``j`` is the
128+@@ -287,23 +288,23 @@ an equally spaced grid with `\Delta x = \Delta y = .25` for
129+ sage: y=numpy.r_[0.0:1.0:5*j]
130+ sage: xx,yy= meshgrid(x,y)
131+ sage: xx
132+- array([[ 0. , 0.25, 0.5 , 0.75, 1. ],
133+- [ 0. , 0.25, 0.5 , 0.75, 1. ],
134+- [ 0. , 0.25, 0.5 , 0.75, 1. ],
135+- [ 0. , 0.25, 0.5 , 0.75, 1. ],
136+- [ 0. , 0.25, 0.5 , 0.75, 1. ]])
137++ array([[0. , 0.25, 0.5 , 0.75, 1. ],
138++ [0. , 0.25, 0.5 , 0.75, 1. ],
139++ [0. , 0.25, 0.5 , 0.75, 1. ],
140++ [0. , 0.25, 0.5 , 0.75, 1. ],
141++ [0. , 0.25, 0.5 , 0.75, 1. ]])
142+ sage: yy
143+- array([[ 0. , 0. , 0. , 0. , 0. ],
144+- [ 0.25, 0.25, 0.25, 0.25, 0.25],
145+- [ 0.5 , 0.5 , 0.5 , 0.5 , 0.5 ],
146+- [ 0.75, 0.75, 0.75, 0.75, 0.75],
147+- [ 1. , 1. , 1. , 1. , 1. ]])
148++ array([[0. , 0. , 0. , 0. , 0. ],
149++ [0.25, 0.25, 0.25, 0.25, 0.25],
150++ [0.5 , 0.5 , 0.5 , 0.5 , 0.5 ],
151++ [0.75, 0.75, 0.75, 0.75, 0.75],
152++ [1. , 1. , 1. , 1. , 1. ]])
153+ sage: f(xx,yy)
154+- array([[ 0. , 0.0625, 0.25 , 0.5625, 1. ],
155+- [ 0.0625, 0.125 , 0.3125, 0.625 , 1.0625],
156+- [ 0.25 , 0.3125, 0.5 , 0.8125, 1.25 ],
157+- [ 0.5625, 0.625 , 0.8125, 1.125 , 1.5625],
158+- [ 1. , 1.0625, 1.25 , 1.5625, 2. ]])
159++ array([[0. , 0.0625, 0.25 , 0.5625, 1. ],
160++ [0.0625, 0.125 , 0.3125, 0.625 , 1.0625],
161++ [0.25 , 0.3125, 0.5 , 0.8125, 1.25 ],
162++ [0.5625, 0.625 , 0.8125, 1.125 , 1.5625],
163++ [1. , 1.0625, 1.25 , 1.5625, 2. ]])
164+
165+ You can see that :meth:`numpy.meshgrid` produces a pair of matrices, here denoted
166+ `xx` and `yy`, such that `(xx[i,j],yy[i,j])` has coordinates
167+@@ -324,7 +325,7 @@ equation `Ax=b` do
168+ sage: b=numpy.array(range(1,6))
169+ sage: x=linalg.solve(A,b)
170+ sage: numpy.dot(A,x)
171+- array([ 1., 2., 3., 4., 5.])
172++ array([1., 2., 3., 4., 5.])
173+
174+ This creates a random 5x5 matrix ``A``, and solves `Ax=b` where
175+ ``b=[0.0,1.0,2.0,3.0,4.0]``. There are many other routines in the :mod:`numpy.linalg`
176+diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
177+index df85cce43d..34ea164be0 100644
178+--- a/src/sage/calculus/riemann.pyx
179++++ b/src/sage/calculus/riemann.pyx
180+@@ -1191,30 +1191,30 @@ cpdef complex_to_spiderweb(np.ndarray[COMPLEX_T, ndim = 2] z_values,
181+ sage: zval = numpy.array([[0, 1, 1000],[.2+.3j,1,-.3j],[0,0,0]],dtype = numpy.complex128)
182+ sage: deriv = numpy.array([[.1]],dtype = numpy.float64)
183+ sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,False,0.001)
184+- array([[[ 1., 1., 1.],
185+- [ 1., 1., 1.],
186+- [ 1., 1., 1.]],
187++ array([[[1., 1., 1.],
188++ [1., 1., 1.],
189++ [1., 1., 1.]],
190+ <BLANKLINE>
191+- [[ 1., 1., 1.],
192+- [ 0., 0., 0.],
193+- [ 1., 1., 1.]],
194++ [[1., 1., 1.],
195++ [0., 0., 0.],
196++ [1., 1., 1.]],
197+ <BLANKLINE>
198+- [[ 1., 1., 1.],
199+- [ 1., 1., 1.],
200+- [ 1., 1., 1.]]])
201++ [[1., 1., 1.],
202++ [1., 1., 1.],
203++ [1., 1., 1.]]])
204+
205+ sage: complex_to_spiderweb(zval, deriv,deriv, 4,4,[0,0,0],1,True,0.001)
206+- array([[[ 1. , 1. , 1. ],
207+- [ 1. , 0.05558355, 0.05558355],
208+- [ 0.17301243, 0. , 0. ]],
209++ array([[[1. , 1. , 1. ],
210++ [1. , 0.05558355, 0.05558355],
211++ [0.17301243, 0. , 0. ]],
212+ <BLANKLINE>
213+- [[ 1. , 0.96804683, 0.48044583],
214+- [ 0. , 0. , 0. ],
215+- [ 0.77351965, 0.5470393 , 1. ]],
216++ [[1. , 0.96804683, 0.48044583],
217++ [0. , 0. , 0. ],
218++ [0.77351965, 0.5470393 , 1. ]],
219+ <BLANKLINE>
220+- [[ 1. , 1. , 1. ],
221+- [ 1. , 1. , 1. ],
222+- [ 1. , 1. , 1. ]]])
223++ [[1. , 1. , 1. ],
224++ [1. , 1. , 1. ],
225++ [1. , 1. , 1. ]]])
226+ """
227+ cdef Py_ssize_t i, j, imax, jmax
228+ cdef FLOAT_T x, y, mag, arg, width, target, precision, dmag, darg
229+@@ -1279,14 +1279,14 @@ cpdef complex_to_rgb(np.ndarray[COMPLEX_T, ndim = 2] z_values):
230+ sage: from sage.calculus.riemann import complex_to_rgb
231+ sage: import numpy
232+ sage: complex_to_rgb(numpy.array([[0, 1, 1000]], dtype = numpy.complex128))
233+- array([[[ 1. , 1. , 1. ],
234+- [ 1. , 0.05558355, 0.05558355],
235+- [ 0.17301243, 0. , 0. ]]])
236++ array([[[1. , 1. , 1. ],
237++ [1. , 0.05558355, 0.05558355],
238++ [0.17301243, 0. , 0. ]]])
239+
240+ sage: complex_to_rgb(numpy.array([[0, 1j, 1000j]], dtype = numpy.complex128))
241+- array([[[ 1. , 1. , 1. ],
242+- [ 0.52779177, 1. , 0.05558355],
243+- [ 0.08650622, 0.17301243, 0. ]]])
244++ array([[[1. , 1. , 1. ],
245++ [0.52779177, 1. , 0.05558355],
246++ [0.08650622, 0.17301243, 0. ]]])
247+
248+
249+ TESTS::
250+diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
251+index 61b1003002..4baee9cbbd 100644
252+--- a/src/sage/combinat/fully_packed_loop.py
253++++ b/src/sage/combinat/fully_packed_loop.py
254+@@ -72,11 +72,11 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
255+ sage: _make_color_list(5, ['blue', 'red'])
256+ ['blue', 'red', 'blue', 'red', 'blue']
257+ sage: _make_color_list(5, color_map='summer')
258+- [(0.0, 0.5, 0.40000000000000002),
259+- (0.25098039215686274, 0.62549019607843137, 0.40000000000000002),
260+- (0.50196078431372548, 0.75098039215686274, 0.40000000000000002),
261+- (0.75294117647058822, 0.87647058823529411, 0.40000000000000002),
262+- (1.0, 1.0, 0.40000000000000002)]
263++ [(0.0, 0.5, 0.4),
264++ (0.25098039215686274, 0.6254901960784314, 0.4),
265++ (0.5019607843137255, 0.7509803921568627, 0.4),
266++ (0.7529411764705882, 0.8764705882352941, 0.4),
267++ (1.0, 1.0, 0.4)]
268+ sage: _make_color_list(8, ['blue', 'red'], randomize=True)
269+ ['blue', 'blue', 'red', 'blue', 'red', 'red', 'red', 'blue']
270+ """
271+diff --git a/src/sage/finance/time_series.pyx b/src/sage/finance/time_series.pyx
272+index c37700d14e..49b7298d0b 100644
273+--- a/src/sage/finance/time_series.pyx
274++++ b/src/sage/finance/time_series.pyx
275+@@ -109,8 +109,8 @@ cdef class TimeSeries:
276+
277+ sage: import numpy
278+ sage: v = numpy.array([[1,2], [3,4]], dtype=float); v
279+- array([[ 1., 2.],
280+- [ 3., 4.]])
281++ array([[1., 2.],
282++ [3., 4.]])
283+ sage: finance.TimeSeries(v)
284+ [1.0000, 2.0000, 3.0000, 4.0000]
285+ sage: finance.TimeSeries(v[:,0])
286+@@ -2098,14 +2098,14 @@ cdef class TimeSeries:
287+
288+ sage: w[0] = 20
289+ sage: w
290+- array([ 20. , -3. , 4.5, -2. ])
291++ array([20. , -3. , 4.5, -2. ])
292+ sage: v
293+ [20.0000, -3.0000, 4.5000, -2.0000]
294+
295+ If you want a separate copy do not give the ``copy=False`` option. ::
296+
297+ sage: z = v.numpy(); z
298+- array([ 20. , -3. , 4.5, -2. ])
299++ array([20. , -3. , 4.5, -2. ])
300+ sage: z[0] = -10
301+ sage: v
302+ [20.0000, -3.0000, 4.5000, -2.0000]
303+diff --git a/src/sage/functions/hyperbolic.py b/src/sage/functions/hyperbolic.py
304+index 931a4b41e4..bf33fc483d 100644
305+--- a/src/sage/functions/hyperbolic.py
306++++ b/src/sage/functions/hyperbolic.py
307+@@ -214,7 +214,7 @@ class Function_coth(GinacFunction):
308+ sage: import numpy
309+ sage: a = numpy.arange(2, 5)
310+ sage: coth(a)
311+- array([ 1.03731472, 1.00496982, 1.00067115])
312++ array([1.03731472, 1.00496982, 1.00067115])
313+ """
314+ return 1.0 / tanh(x)
315+
316+@@ -267,7 +267,7 @@ class Function_sech(GinacFunction):
317+ sage: import numpy
318+ sage: a = numpy.arange(2, 5)
319+ sage: sech(a)
320+- array([ 0.26580223, 0.09932793, 0.03661899])
321++ array([0.26580223, 0.09932793, 0.03661899])
322+ """
323+ return 1.0 / cosh(x)
324+
325+@@ -318,7 +318,7 @@ class Function_csch(GinacFunction):
326+ sage: import numpy
327+ sage: a = numpy.arange(2, 5)
328+ sage: csch(a)
329+- array([ 0.27572056, 0.09982157, 0.03664357])
330++ array([0.27572056, 0.09982157, 0.03664357])
331+ """
332+ return 1.0 / sinh(x)
333+
334+@@ -586,7 +586,7 @@ class Function_arccoth(GinacFunction):
335+ sage: import numpy
336+ sage: a = numpy.arange(2,5)
337+ sage: acoth(a)
338+- array([ 0.54930614, 0.34657359, 0.25541281])
339++ array([0.54930614, 0.34657359, 0.25541281])
340+ """
341+ return arctanh(1.0 / x)
342+
343+diff --git a/src/sage/functions/orthogonal_polys.py b/src/sage/functions/orthogonal_polys.py
344+index 017c85a96f..33fbb499c5 100644
345+--- a/src/sage/functions/orthogonal_polys.py
346++++ b/src/sage/functions/orthogonal_polys.py
347+@@ -810,12 +810,12 @@ class Func_chebyshev_T(ChebyshevFunction):
348+ sage: z2 = numpy.array([[1,2],[1,2]])
349+ sage: z3 = numpy.array([1,2,3.])
350+ sage: chebyshev_T(1,z)
351+- array([ 1., 2.])
352++ array([1., 2.])
353+ sage: chebyshev_T(1,z2)
354+- array([[ 1., 2.],
355+- [ 1., 2.]])
356++ array([[1., 2.],
357++ [1., 2.]])
358+ sage: chebyshev_T(1,z3)
359+- array([ 1., 2., 3.])
360++ array([1., 2., 3.])
361+ sage: chebyshev_T(z,0.1)
362+ array([ 0.1 , -0.98])
363+ """
364+@@ -1095,12 +1095,12 @@ class Func_chebyshev_U(ChebyshevFunction):
365+ sage: z2 = numpy.array([[1,2],[1,2]])
366+ sage: z3 = numpy.array([1,2,3.])
367+ sage: chebyshev_U(1,z)
368+- array([ 2., 4.])
369++ array([2., 4.])
370+ sage: chebyshev_U(1,z2)
371+- array([[ 2., 4.],
372+- [ 2., 4.]])
373++ array([[2., 4.],
374++ [2., 4.]])
375+ sage: chebyshev_U(1,z3)
376+- array([ 2., 4., 6.])
377++ array([2., 4., 6.])
378+ sage: chebyshev_U(z,0.1)
379+ array([ 0.2 , -0.96])
380+ """
381+diff --git a/src/sage/functions/other.py b/src/sage/functions/other.py
382+index 679384c907..d63b295a4c 100644
383+--- a/src/sage/functions/other.py
384++++ b/src/sage/functions/other.py
385+@@ -390,7 +390,7 @@ class Function_ceil(BuiltinFunction):
386+ sage: import numpy
387+ sage: a = numpy.linspace(0,2,6)
388+ sage: ceil(a)
389+- array([ 0., 1., 1., 2., 2., 2.])
390++ array([0., 1., 1., 2., 2., 2.])
391+
392+ Test pickling::
393+
394+@@ -539,7 +539,7 @@ class Function_floor(BuiltinFunction):
395+ sage: import numpy
396+ sage: a = numpy.linspace(0,2,6)
397+ sage: floor(a)
398+- array([ 0., 0., 0., 1., 1., 2.])
399++ array([0., 0., 0., 1., 1., 2.])
400+ sage: floor(x)._sympy_()
401+ floor(x)
402+
403+@@ -840,7 +840,7 @@ def sqrt(x, *args, **kwds):
404+ sage: import numpy
405+ sage: a = numpy.arange(2,5)
406+ sage: sqrt(a)
407+- array([ 1.41421356, 1.73205081, 2. ])
408++ array([1.41421356, 1.73205081, 2. ])
409+ """
410+ if isinstance(x, float):
411+ return math.sqrt(x)
412+diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py
413+index e7e7a311cd..e7ff78a9de 100644
414+--- a/src/sage/functions/trig.py
415++++ b/src/sage/functions/trig.py
416+@@ -731,7 +731,7 @@ class Function_arccot(GinacFunction):
417+ sage: import numpy
418+ sage: a = numpy.arange(2, 5)
419+ sage: arccot(a)
420+- array([ 0.46364761, 0.32175055, 0.24497866])
421++ array([0.46364761, 0.32175055, 0.24497866])
422+ """
423+ return math.pi/2 - arctan(x)
424+
425+@@ -787,7 +787,7 @@ class Function_arccsc(GinacFunction):
426+ sage: import numpy
427+ sage: a = numpy.arange(2, 5)
428+ sage: arccsc(a)
429+- array([ 0.52359878, 0.33983691, 0.25268026])
430++ array([0.52359878, 0.33983691, 0.25268026])
431+ """
432+ return arcsin(1.0/x)
433+
434+@@ -845,7 +845,7 @@ class Function_arcsec(GinacFunction):
435+ sage: import numpy
436+ sage: a = numpy.arange(2, 5)
437+ sage: arcsec(a)
438+- array([ 1.04719755, 1.23095942, 1.31811607])
439++ array([1.04719755, 1.23095942, 1.31811607])
440+ """
441+ return arccos(1.0/x)
442+
443+@@ -920,13 +920,13 @@ class Function_arctan2(GinacFunction):
444+ sage: a = numpy.linspace(1, 3, 3)
445+ sage: b = numpy.linspace(3, 6, 3)
446+ sage: atan2(a, b)
447+- array([ 0.32175055, 0.41822433, 0.46364761])
448++ array([0.32175055, 0.41822433, 0.46364761])
449+
450+ sage: atan2(1,a)
451+- array([ 0.78539816, 0.46364761, 0.32175055])
452++ array([0.78539816, 0.46364761, 0.32175055])
453+
454+ sage: atan2(a, 1)
455+- array([ 0.78539816, 1.10714872, 1.24904577])
456++ array([0.78539816, 1.10714872, 1.24904577])
457+
458+ TESTS::
459+
460+diff --git a/src/sage/matrix/constructor.pyx b/src/sage/matrix/constructor.pyx
461+index 19a1d37df0..5780dfae1c 100644
462+--- a/src/sage/matrix/constructor.pyx
463++++ b/src/sage/matrix/constructor.pyx
464+@@ -494,8 +494,8 @@ class MatrixFactory(object):
465+ [7 8 9]
466+ Full MatrixSpace of 3 by 3 dense matrices over Integer Ring
467+ sage: n = matrix(QQ, 2, 2, [1, 1/2, 1/3, 1/4]).numpy(); n
468+- array([[ 1. , 0.5 ],
469+- [ 0.33333333, 0.25 ]])
470++ array([[1. , 0.5 ],
471++ [0.33333333, 0.25 ]])
472+ sage: matrix(QQ, n)
473+ [ 1 1/2]
474+ [1/3 1/4]
475+diff --git a/src/sage/matrix/matrix_double_dense.pyx b/src/sage/matrix/matrix_double_dense.pyx
476+index 48e0a8a97f..1be5d35b19 100644
477+--- a/src/sage/matrix/matrix_double_dense.pyx
478++++ b/src/sage/matrix/matrix_double_dense.pyx
479+@@ -2546,7 +2546,7 @@ cdef class Matrix_double_dense(Matrix_dense):
480+ sage: P.is_unitary(algorithm='orthonormal')
481+ Traceback (most recent call last):
482+ ...
483+- ValueError: failed to create intent(cache|hide)|optional array-- must have defined dimensions but got (0,)
484++ error: ((lwork==-1)||(lwork >= MAX(1,2*n))) failed for 3rd keyword lwork: zgees:lwork=0
485+
486+ TESTS::
487+
488+@@ -3662,8 +3662,8 @@ cdef class Matrix_double_dense(Matrix_dense):
489+ [0.0 1.0 2.0]
490+ [3.0 4.0 5.0]
491+ sage: m.numpy()
492+- array([[ 0., 1., 2.],
493+- [ 3., 4., 5.]])
494++ array([[0., 1., 2.],
495++ [3., 4., 5.]])
496+
497+ Alternatively, numpy automatically calls this function (via
498+ the magic :meth:`__array__` method) to convert Sage matrices
499+@@ -3674,16 +3674,16 @@ cdef class Matrix_double_dense(Matrix_dense):
500+ [0.0 1.0 2.0]
501+ [3.0 4.0 5.0]
502+ sage: numpy.array(m)
503+- array([[ 0., 1., 2.],
504+- [ 3., 4., 5.]])
505++ array([[0., 1., 2.],
506++ [3., 4., 5.]])
507+ sage: numpy.array(m).dtype
508+ dtype('float64')
509+ sage: m = matrix(CDF, 2, range(6)); m
510+ [0.0 1.0 2.0]
511+ [3.0 4.0 5.0]
512+ sage: numpy.array(m)
513+- array([[ 0.+0.j, 1.+0.j, 2.+0.j],
514+- [ 3.+0.j, 4.+0.j, 5.+0.j]])
515++ array([[0.+0.j, 1.+0.j, 2.+0.j],
516++ [3.+0.j, 4.+0.j, 5.+0.j]])
517+ sage: numpy.array(m).dtype
518+ dtype('complex128')
519+
520+diff --git a/src/sage/matrix/special.py b/src/sage/matrix/special.py
521+index c698ba5e97..b743bab354 100644
522+--- a/src/sage/matrix/special.py
523++++ b/src/sage/matrix/special.py
524+@@ -705,7 +705,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
525+
526+ sage: import numpy
527+ sage: entries = numpy.array([1.2, 5.6]); entries
528+- array([ 1.2, 5.6])
529++ array([1.2, 5.6])
530+ sage: A = diagonal_matrix(3, entries); A
531+ [1.2 0.0 0.0]
532+ [0.0 5.6 0.0]
533+@@ -715,7 +715,7 @@ def diagonal_matrix(arg0=None, arg1=None, arg2=None, sparse=True):
534+
535+ sage: j = numpy.complex(0,1)
536+ sage: entries = numpy.array([2.0+j, 8.1, 3.4+2.6*j]); entries
537+- array([ 2.0+1.j , 8.1+0.j , 3.4+2.6j])
538++ array([2. +1.j , 8.1+0.j , 3.4+2.6j])
539+ sage: A = diagonal_matrix(entries); A
540+ [2.0 + 1.0*I 0.0 0.0]
541+ [ 0.0 8.1 0.0]
542+diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
543+index 230f142117..2ab1c0ae68 100644
544+--- a/src/sage/modules/free_module_element.pyx
545++++ b/src/sage/modules/free_module_element.pyx
546+@@ -982,7 +982,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
547+ sage: v.numpy()
548+ array([1, 2, 5/6], dtype=object)
549+ sage: v.numpy(dtype=float)
550+- array([ 1. , 2. , 0.83333333])
551++ array([1. , 2. , 0.83333333])
552+ sage: v.numpy(dtype=int)
553+ array([1, 2, 0])
554+ sage: import numpy
555+@@ -993,7 +993,7 @@ cdef class FreeModuleElement(Vector): # abstract base class
556+ be more efficient but may have unintended consequences::
557+
558+ sage: v.numpy(dtype=None)
559+- array([ 1. , 2. , 0.83333333])
560++ array([1. , 2. , 0.83333333])
561+
562+ sage: w = vector(ZZ, [0, 1, 2^63 -1]); w
563+ (0, 1, 9223372036854775807)
564+diff --git a/src/sage/modules/vector_double_dense.pyx b/src/sage/modules/vector_double_dense.pyx
565+index 39fc2970de..2badf98284 100644
566+--- a/src/sage/modules/vector_double_dense.pyx
567++++ b/src/sage/modules/vector_double_dense.pyx
568+@@ -807,13 +807,13 @@ cdef class Vector_double_dense(FreeModuleElement):
569+
570+ sage: v = vector(CDF,4,range(4))
571+ sage: v.numpy()
572+- array([ 0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j])
573++ array([0.+0.j, 1.+0.j, 2.+0.j, 3.+0.j])
574+ sage: v = vector(CDF,0)
575+ sage: v.numpy()
576+ array([], dtype=complex128)
577+ sage: v = vector(RDF,4,range(4))
578+ sage: v.numpy()
579+- array([ 0., 1., 2., 3.])
580++ array([0., 1., 2., 3.])
581+ sage: v = vector(RDF,0)
582+ sage: v.numpy()
583+ array([], dtype=float64)
584+@@ -823,11 +823,11 @@ cdef class Vector_double_dense(FreeModuleElement):
585+ sage: import numpy
586+ sage: v = vector(CDF, 3, range(3))
587+ sage: v.numpy()
588+- array([ 0.+0.j, 1.+0.j, 2.+0.j])
589++ array([0.+0.j, 1.+0.j, 2.+0.j])
590+ sage: v.numpy(dtype=numpy.float64)
591+- array([ 0., 1., 2.])
592++ array([0., 1., 2.])
593+ sage: v.numpy(dtype=numpy.float32)
594+- array([ 0., 1., 2.], dtype=float32)
595++ array([0., 1., 2.], dtype=float32)
596+ """
597+ if dtype is None or dtype is self._vector_numpy.dtype:
598+ from copy import copy
599+diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
600+index 17b5ebb84b..92ce35c502 100644
601+--- a/src/sage/numerical/optimize.py
602++++ b/src/sage/numerical/optimize.py
603+@@ -486,9 +486,9 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
604+ else:
605+ min = optimize.fmin_tnc(f, x0, approx_grad=True, bounds=cons, messages=0, **args)[0]
606+ elif isinstance(cons[0], function_type) or isinstance(cons[0], Expression):
607+- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args)
608++ min = optimize.fmin_cobyla(f, x0, cons, disp=0, **args)
609+ elif isinstance(cons, function_type) or isinstance(cons, Expression):
610+- min = optimize.fmin_cobyla(f, x0, cons, iprint=0, **args)
611++ min = optimize.fmin_cobyla(f, x0, cons, disp=0, **args)
612+ return vector(RDF, min)
613+
614+
615+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
616+index ad9693da62..758fb709b7 100644
617+--- a/src/sage/plot/complex_plot.pyx
618++++ b/src/sage/plot/complex_plot.pyx
619+@@ -61,9 +61,9 @@ cdef inline double mag_to_lightness(double r):
620+
621+ sage: from sage.plot.complex_plot import complex_to_rgb
622+ sage: complex_to_rgb([[0, 1, 10]])
623+- array([[[ 0. , 0. , 0. ],
624+- [ 0.77172568, 0. , 0. ],
625+- [ 1. , 0.22134776, 0.22134776]]])
626++ array([[[0. , 0. , 0. ],
627++ [0.77172568, 0. , 0. ],
628++ [1. , 0.22134776, 0.22134776]]])
629+ """
630+ return atan(log(sqrt(r)+1)) * (4/PI) - 1
631+
632+@@ -82,13 +82,13 @@ def complex_to_rgb(z_values):
633+
634+ sage: from sage.plot.complex_plot import complex_to_rgb
635+ sage: complex_to_rgb([[0, 1, 1000]])
636+- array([[[ 0. , 0. , 0. ],
637+- [ 0.77172568, 0. , 0. ],
638+- [ 1. , 0.64421177, 0.64421177]]])
639++ array([[[0. , 0. , 0. ],
640++ [0.77172568, 0. , 0. ],
641++ [1. , 0.64421177, 0.64421177]]])
642+ sage: complex_to_rgb([[0, 1j, 1000j]])
643+- array([[[ 0. , 0. , 0. ],
644+- [ 0.38586284, 0.77172568, 0. ],
645+- [ 0.82210588, 1. , 0.64421177]]])
646++ array([[[0. , 0. , 0. ],
647++ [0.38586284, 0.77172568, 0. ],
648++ [0.82210588, 1. , 0.64421177]]])
649+ """
650+ import numpy
651+ cdef unsigned int i, j, imax, jmax
652+diff --git a/src/sage/plot/line.py b/src/sage/plot/line.py
653+index 23f5e61446..3b1b51d7cf 100644
654+--- a/src/sage/plot/line.py
655++++ b/src/sage/plot/line.py
656+@@ -502,14 +502,12 @@ def line2d(points, **options):
657+ from sage.plot.all import Graphics
658+ from sage.plot.plot import xydata_from_point_list
659+ from sage.rings.all import CC, CDF
660++ points = list(points) # make sure points is a python list
661+ if points in CC or points in CDF:
662+ pass
663+ else:
664+- try:
665+- if not points:
666+- return Graphics()
667+- except ValueError: # numpy raises a ValueError if not empty
668+- pass
669++ if len(points) == 0:
670++ return Graphics()
671+ xdata, ydata = xydata_from_point_list(points)
672+ g = Graphics()
673+ g._set_extra_kwds(Graphics._extract_kwds_for_show(options))
674+diff --git a/src/sage/plot/plot_field.py b/src/sage/plot/plot_field.py
675+index 0025098a8d..23c80902f3 100644
676+--- a/src/sage/plot/plot_field.py
677++++ b/src/sage/plot/plot_field.py
678+@@ -49,9 +49,10 @@ class PlotField(GraphicPrimitive):
679+ sage: r.xpos_array
680+ [0.0, 0.0, 1.0, 1.0]
681+ sage: r.yvec_array
682+- masked_array(data = [0.0 0.70710678118... 0.70710678118... 0.89442719...],
683+- mask = [False False False False],
684+- fill_value = 1e+20)
685++ masked_array(data=[0.0, 0.70710678118..., 0.70710678118...,
686++ 0.89442719...],
687++ mask=[False, False, False, False],
688++ fill_value=1e+20)
689+
690+ TESTS:
691+
692+diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
693+index f3da57c370..3806f4b32f 100644
694+--- a/src/sage/plot/streamline_plot.py
695++++ b/src/sage/plot/streamline_plot.py
696+@@ -38,16 +38,14 @@ class StreamlinePlot(GraphicPrimitive):
697+ sage: r.options()['plot_points']
698+ 2
699+ sage: r.xpos_array
700+- array([ 0., 1.])
701++ array([0., 1.])
702+ sage: r.yvec_array
703+- masked_array(data =
704+- [[1.0 1.0]
705+- [0.5403023058681398 0.5403023058681398]],
706+- mask =
707+- [[False False]
708+- [False False]],
709+- fill_value = 1e+20)
710+- <BLANKLINE>
711++ masked_array(
712++ data=[[1.0, 1.0],
713++ [0.5403023058681398, 0.5403023058681398]],
714++ mask=[[False, False],
715++ [False, False]],
716++ fill_value=1e+20)
717+
718+ TESTS:
719+
720+diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
721+index f66cd898b9..35995886d5 100644
722+--- a/src/sage/probability/probability_distribution.pyx
723++++ b/src/sage/probability/probability_distribution.pyx
724+@@ -130,7 +130,17 @@ cdef class ProbabilityDistribution:
725+ 0.0,
726+ 1.4650000000000003]
727+ sage: b
728+- [0.0, 0.20000000000000001, 0.40000000000000002, 0.60000000000000009, 0.80000000000000004, 1.0, 1.2000000000000002, 1.4000000000000001, 1.6000000000000001, 1.8, 2.0]
729++ [0.0,
730++ 0.2,
731++ 0.4,
732++ 0.6000000000000001,
733++ 0.8,
734++ 1.0,
735++ 1.2000000000000002,
736++ 1.4000000000000001,
737++ 1.6,
738++ 1.8,
739++ 2.0]
740+ """
741+ import pylab
742+ l = [float(self.get_random_element()) for _ in range(num_samples)]
743+diff --git a/src/sage/rings/rational.pyx b/src/sage/rings/rational.pyx
744+index a0bfe080f5..7d95e7a1a8 100644
745+--- a/src/sage/rings/rational.pyx
746++++ b/src/sage/rings/rational.pyx
747+@@ -1056,7 +1056,7 @@ cdef class Rational(sage.structure.element.FieldElement):
748+ dtype('O')
749+
750+ sage: numpy.array([1, 1/2, 3/4])
751+- array([ 1. , 0.5 , 0.75])
752++ array([1. , 0.5 , 0.75])
753+ """
754+ if mpz_cmp_ui(mpq_denref(self.value), 1) == 0:
755+ if mpz_fits_slong_p(mpq_numref(self.value)):
756+diff --git a/src/sage/rings/real_mpfr.pyx b/src/sage/rings/real_mpfr.pyx
757+index 4c630867a4..64e2187f5b 100644
758+--- a/src/sage/rings/real_mpfr.pyx
759++++ b/src/sage/rings/real_mpfr.pyx
760+@@ -1438,7 +1438,7 @@ cdef class RealNumber(sage.structure.element.RingElement):
761+
762+ sage: import numpy
763+ sage: numpy.arange(10.0)
764+- array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
765++ array([0., 1., 2., 3., 4., 5., 6., 7., 8., 9.])
766+ sage: numpy.array([1.0, 1.1, 1.2]).dtype
767+ dtype('float64')
768+ sage: numpy.array([1.000000000000000000000000000000000000]).dtype
769+diff --git a/src/sage/schemes/elliptic_curves/height.py b/src/sage/schemes/elliptic_curves/height.py
770+index 3d270ebf9d..1144f168e3 100644
771+--- a/src/sage/schemes/elliptic_curves/height.py
772++++ b/src/sage/schemes/elliptic_curves/height.py
773+@@ -1623,18 +1623,18 @@ class EllipticCurveCanonicalHeight:
774+ even::
775+
776+ sage: H.wp_on_grid(v,4)
777+- array([[ 25.43920182, 5.28760943, 5.28760943, 25.43920182],
778+- [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
779+- [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
780+- [ 25.43920182, 5.28760943, 5.28760943, 25.43920182]])
781++ array([[25.43920182, 5.28760943, 5.28760943, 25.43920182],
782++ [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
783++ [ 6.05099485, 1.83757786, 1.83757786, 6.05099485],
784++ [25.43920182, 5.28760943, 5.28760943, 25.43920182]])
785+
786+ The array of values on the half-grid::
787+
788+ sage: H.wp_on_grid(v,4,True)
789+- array([[ 25.43920182, 5.28760943],
790+- [ 6.05099485, 1.83757786],
791+- [ 6.05099485, 1.83757786],
792+- [ 25.43920182, 5.28760943]])
793++ array([[25.43920182, 5.28760943],
794++ [ 6.05099485, 1.83757786],
795++ [ 6.05099485, 1.83757786],
796++ [25.43920182, 5.28760943]])
797+ """
798+ tau = self.tau(v)
799+ fk, err = self.fk_intervals(v, 15, CDF)
800+diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
801+index 2dcb0492b9..2b1a06385c 100644
802+--- a/src/sage/symbolic/ring.pyx
803++++ b/src/sage/symbolic/ring.pyx
804+@@ -1135,7 +1135,7 @@ cdef class NumpyToSRMorphism(Morphism):
805+ sage: cos(numpy.int('2'))
806+ cos(2)
807+ sage: numpy.cos(numpy.int('2'))
808+- -0.41614683654714241
809++ -0.4161468365471424
810+ """
811+ cdef _intermediate_ring
812+