Skip to content

Commit 9602c15

Browse files
committed
STY: stats.lmoment: avoid mutable defaults in signature
1 parent 72aa29a commit 9602c15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scipy/stats/_stats_py.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10175,7 +10175,7 @@ def lmoment_iv(sample, order, axis, sorted, standardize):
1017510175
raise ValueError(message)
1017610176

1017710177
message = "`order` must be a scalar or a non-empty array of positive integers."
10178-
order = np.asarray(order)
10178+
order = np.arange(1, 5) if order is None else np.asarray(order)
1017910179
if not np.issubdtype(order.dtype, np.integer) or np.any(order <= 0):
1018010180
raise ValueError(message)
1018110181

@@ -10219,7 +10219,7 @@ def _prk(r, k):
1021910219
_moment_result_object, n_samples=1, result_to_tuple=lambda x: (x,),
1022010220
n_outputs=lambda kwds: _moment_outputs(kwds, [1, 2, 3, 4])
1022110221
)
10222-
def lmoment(sample, order=[1, 2, 3, 4], *, axis=0, sorted=False, standardize=True):
10222+
def lmoment(sample, order=None, *, axis=0, sorted=False, standardize=True):
1022310223
r"""Compute L-moments of a sample from a continuous distribution
1022410224
1022510225
The L-moments of a probability distribution are summary statistics with

0 commit comments

Comments
 (0)