ó
    ¢9iÕ  ã                   ó\   • S SK rS SKJr  S SKJr  SSKJr  \" S SS S9SS	S
.S jj5       rg)é    N)Ú_get_nan)Úarray_namespaceé   )Ú_axis_nan_policy_factoryc                 ó   • U $ ©N© )Úxs    ÚV/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/scipy/stats/_variation.pyÚ<lambda>r   
   s   € ‰aó    c                 ó   • U 4$ r   r	   )r
   Ú_s     r   r   r   
   s   € ¸A¹4r   )Ú	n_outputsÚresult_to_tupleF)Úkeepdimsc                óÂ  • [        U 5      nUR                  U 5      n Uc  UR                  U S5      n SnU R                  U   nU R                  S:X  d  X6:”  a:  [        U R                  5      nUR                  U5        [        U [        U5      US9$ UR                  XS9nX6:X  aa  UR                  XSS9n	UR                  U	S:„  UR                  UR                  U5      UR                  5      n
U
R                  S:X  a  U
S   $ U
$ [         R"                  " SSS	9   UR                  XUS9n	X˜-  n
SSS5        W
R                  S:X  a  U
S   $ U
$ ! , (       d  f       N%= f)
aq  
Compute the coefficient of variation.

The coefficient of variation is the standard deviation divided by the
mean.  This function is equivalent to::

    np.std(x, axis=axis, ddof=ddof) / np.mean(x)

The default for ``ddof`` is 0, but many definitions of the coefficient
of variation use the square root of the unbiased sample variance
for the sample standard deviation, which corresponds to ``ddof=1``.

The function does not take the absolute value of the mean of the data,
so the return value is negative if the mean is negative.

Parameters
----------
a : array_like
    Input array.
axis : int or None, optional
    Axis along which to calculate the coefficient of variation.
    Default is 0. If None, compute over the whole array `a`.
nan_policy : {'propagate', 'raise', 'omit'}, optional
    Defines how to handle when input contains ``nan``.
    The following options are available:

      * 'propagate': return ``nan``
      * 'raise': raise an exception
      * 'omit': perform the calculation with ``nan`` values omitted

    The default is 'propagate'.
ddof : int, optional
    Gives the "Delta Degrees Of Freedom" used when computing the
    standard deviation.  The divisor used in the calculation of the
    standard deviation is ``N - ddof``, where ``N`` is the number of
    elements.  `ddof` must be less than ``N``; if it isn't, the result
    will be ``nan`` or ``inf``, depending on ``N`` and the values in
    the array.  By default `ddof` is zero for backwards compatibility,
    but it is recommended to use ``ddof=1`` to ensure that the sample
    standard deviation is computed as the square root of the unbiased
    sample variance.

Returns
-------
variation : ndarray
    The calculated variation along the requested axis.

Notes
-----
There are several edge cases that are handled without generating a
warning:

* If both the mean and the standard deviation are zero, ``nan``
  is returned.
* If the mean is zero and the standard deviation is nonzero, ``inf``
  is returned.
* If the input has length zero (either because the array has zero
  length, or all the input values are ``nan`` and ``nan_policy`` is
  ``'omit'``), ``nan`` is returned.
* If the input contains ``inf``, ``nan`` is returned.

References
----------
.. [1] Zwillinger, D. and Kokoska, S. (2000). CRC Standard
   Probability and Statistics Tables and Formulae. Chapman & Hall: New
   York. 2000.

Examples
--------
>>> import numpy as np
>>> from scipy.stats import variation
>>> variation([1, 2, 3, 4, 5], ddof=1)
0.5270462766947299

Compute the variation along a given dimension of an array that contains
a few ``nan`` values:

>>> x = np.array([[  10.0, np.nan, 11.0, 19.0, 23.0, 29.0, 98.0],
...               [  29.0,   30.0, 32.0, 33.0, 35.0, 56.0, 57.0],
...               [np.nan, np.nan, 12.0, 13.0, 16.0, 16.0, 17.0]])
>>> variation(x, axis=1, ddof=1, nan_policy='omit')
array([1.05109361, 0.31428986, 0.146483  ])

N)éÿÿÿÿr   )ÚshapeÚxp)Úaxis)r   Ú
correctionr	   Úignore)ÚdivideÚinvalid)r   ÚasarrayÚreshaper   ÚsizeÚlistÚpopr   ÚtupleÚmeanÚstdÚwhereÚcopysignÚinfÚnanÚndimÚnpÚerrstate)Úar   Ú
nan_policyÚddofr   r   Únr   Úmean_aÚstd_aÚresults              r   Ú	variationr2   	   s<  € ôp 
˜Ó	€BØ

‰
1‹€Að |ØJ‰Jq˜%Ó ˆØˆà	‰‰€Aà‡vvƒ{d“hô Q—W‘W“ˆØ	‰	$ŒÜ˜¤ u£°"Ñ5Ð5àW‰WQˆWÐ"€Fàƒyà—‘q°Ð2ˆØ—‘˜% !™) R§[¡[°·±¸Ó%@À"Ç&Á&ÓIˆØ#Ÿ[™[¨AÓ-ˆvb‰zÐ9°6Ð9ä	Š˜H¨hÓ	7Ø—‘q°Ð5ˆØ‘ˆ÷ 
8ð  Ÿ™¨Ó)ˆ6"‰:Ð5¨vÐ5÷	 
8Õ	7ús   ÄEÅ
E)r   Ú	propagater   )	Únumpyr)   Úscipy._lib._utilr   Úscipy._lib._array_apir   Ú_axis_nan_policyr   r2   r	   r   r   Ú<module>r8      s<   ðÛ å %Ý 1å 6ñ Ù˜1Ñ.?ñðr6ÀUõ r6óñr6r   