Skip to content

Commit

Permalink
Fix doctest issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodmillman committed Jan 15, 2025
1 parent f923b24 commit c489c2c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions advanced/mathematical_optimization/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -613,16 +613,16 @@ are also supported by L-BFGS-B::
>>> def jacobian(x):
... return np.array((-2*.5*(1 - x[0]) - 4*x[0]*(x[1] - x[0]**2), 2*(x[1] - x[0]**2)))
>>> sp.optimize.minimize(f, [2, 2], method="L-BFGS-B", jac=jacobian)
message: CONVERGENCE: NORM_OF_PROJECTED_GRADIENT_<=_PGTOL
success: True
status: 0
fun: 1.4417677473...e-15
x: [ 1.000e+00 1.000e+00]
nit: 16
jac: [ 1.023e-07 -2.593e-08]
nfev: 17
njev: 17
hess_inv: <2x2 LbfgsInvHessProduct with dtype=float64>
message: CONVERGENCE: NORM OF PROJECTED GRADIENT <= PGTOL
success: True
status: 0
fun: 1.4417677473...e-15
x: [ 1.000e+00 1.000e+00]
nit: 16
jac: [ 1.023e-07 -2.593e-08]
nfev: 17
njev: 17
hess_inv: <2x2 LbfgsInvHessProduct with dtype=float64>

Gradient-less methods
----------------------
Expand Down
2 changes: 1 addition & 1 deletion advanced/scipy_sparse/solvers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ LinearOperator Class
...
>>> A = sp.sparse.linalg.LinearOperator((2, 2), matvec=mv)
>>> A
<2x2 _CustomLinearOperator with dtype=float64>
<2x2 _CustomLinearOperator with dtype=int8>
>>> A.matvec(np.ones(2))
array([2., 3.])
>>> A * np.ones(2)
Expand Down
2 changes: 1 addition & 1 deletion packages/statistics/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ will affect the conclusions of the test, we can use a `Wilcoxon signed-rank test
this assumption at the expense of test power::

>>> sp.stats.wilcoxon(data['VIQ'])
WilcoxonResult(statistic=np.float64(0.0), pvalue=np.float64(1.8189894...e-12))
WilcoxonResult(statistic=np.float64(0.0), pvalue=np.float64(3.4881726...e-08))

Two-sample t-test: testing for difference across populations
............................................................
Expand Down

0 comments on commit c489c2c

Please sign in to comment.