
    6Dh!                     4    S r / SQrS rS rS rS rS rS rg)	a  
The `trendline_functions` module contains functions which are called by Plotly Express
when the `trendline` argument is used. Valid values for `trendline` are the names of the
functions in this module, and the value of the `trendline_options` argument to PX
functions is passed in as the first argument to these functions when called.

Note that the functions in this module are not meant to be called directly, and are
exposed as part of the public API for documentation purposes.
)olslowessrollingewm	expandingc                    SSK n/ SQnU R                  5        H+  n	X;  d  M
  [        SSR                  U5      < SU	< S35      e   SSKJn
  U R                  SS	5      nU R                  S
S5      nU R                  SS5      nU(       a:  UR                  US:*  5      (       a  [        S5      eUR                  U5      nSU-  nU(       a:  UR                  US:*  5      (       a  [        S5      eUR                  U5      nSU-  nU(       a  U
R                  U5      nU
R                  X2SS9R                  5       nUR                  5       nU(       a  UR                  SU5      nSn[        UR                  5      S:X  a'  USUUR                  S   UUR                  S   4-  -  nO5U(       d  USX^R                  S   U4-  -  nOUSX^R                  S   4-  -  nUSUR                   -  -  nUUU4$ )a  Ordinary Least Squares (OLS) trendline function

Requires `statsmodels` to be installed.

This trendline function causes fit results to be stored within the figure,
accessible via the `plotly.express.get_trendline_results` function. The fit results
are the output of the `statsmodels.api.OLS` function.

Valid keys for the `trendline_options` dict are:

- `add_constant` (`bool`, default `True`): if `False`, the trendline passes through
the origin but if `True` a y-intercept is fitted.

- `log_x` and `log_y` (`bool`, default `False`): if `True` the OLS is computed with
respect to the base 10 logarithm of the input. Note that this means no zeros can
be present in the input.
    N)add_constantlog_xlog_yz+OLS trendline_options keys must be one of [, ] but got ''r	   Tr
   Fr   zOCan't do OLS trendline with `log_y=True` when `y` contains non-positive values.z	log10(%s)zPCan't do OLS trendline with `log_x=True` when `x`  contains non-positive values.drop)missing
   z<b>OLS trendline</b><br>   z%s = %g * %s + %g<br>   z%s = %g * %s<br>z%s = %g<br>zR<sup>2</sup>=%f<br><br>)numpykeys
ValueErrorjoinstatsmodels.apiapigetanylog10r	   OLSfitpredictpowerlenparamsrsquared)trendline_optionsx_rawxyx_labely_labelnon_missingnpvalid_optionsksmr	   r
   r   fit_resultsy_outhover_headers                    ]/var/www/html/env/lib/python3.13/site-packages/plotly/express/trendline_functions/__init__.pyr   r      s   $ 6M##%!99]+Q0  & !$((>L!!'51E!!'51E66!q&>>a  HHQK'66!q&>>b  HHQK'OOA&&v&.224K!EU#-L
;!#/q!q!	3
 
 	
 *g7I7I!7Lg-VVV2D2DQ2G(HHH.1E1EEEL,++    c                    S/nU R                  5        H+  nX;  d  M
  [        SSR                  U5      < SU< S35      e   SSKJn	  U R                  SS5      n
U	R                  R                  X2S	U
S
9SS2S4   nSnXS4$ )a  LOcally WEighted Scatterplot Smoothing (LOWESS) trendline function

Requires `statsmodels` to be installed.

Valid keys for the `trendline_options` dict are:

- `frac` (`float`, default `0.6666666`): the `frac` parameter from the
`statsmodels.api.nonparametric.lowess` function
fracz.LOWESS trendline_options keys must be one of [r   r   r   r   Ng1UU?r   )r   r5   r   z<b>LOWESS trendline</b><br><br>)r   r   r   r   r   r   nonparametricr   )r$   r%   r&   r'   r(   r)   r*   r,   r-   r.   r5   r0   r1   s                r2   r   r   T   s     HM##%!99]+Q0  & !  3D##A&t#DQTJE4L$$r3   c                    SS K n SS Kn[        SSSS9nUR	                  5       nUR                  SS5      n	UR                  S	[        5       5      n
UR                  UR	                  U5      UR                  5       S
9n[        X5      nU" S0 UD6n[        X5      nU" S0 U
D6nX   nSX   < SU	< S3nUUS 4$ ! [         a    Sn[        U5      ef = f)Nr   z)Trendline requires pandas to be installedRollingzExponentially Weighted	Expanding)r   r   r   functionmeanfunction_args)indexz<b> z trendline</b><br><br> )	r   pandasImportErrordictcopypopSeries	to_pandasgetattr)moder$   r%   r'   r*   r+   pdmsgmodesfunction_namer<   seriesaggagg_objr:   r0   r1   s                    r2   _pandasrP   o   s    
 (@KXE)..0%))*f=M%))/46BMYYrwwqz):Y;F &
C&%&Gw.H%}%EE7<{MRL,$$+  9#s   B: :Cc                     [        SXX65      $ )aS  Rolling trendline function

The value of the `function` key of the `trendline_options` dict is the function to
use (defaults to `mean`) and the value of the `function_args` key are taken to be
its arguments as a dict. The remainder of  the `trendline_options` dict is passed as
keyword arguments into the `pandas.Series.rolling` function.
r   rP   r$   r%   r&   r'   r(   r)   r*   s          r2   r   r      s     9/GGr3   c                     [        SXX65      $ )aW  Expanding trendline function

The value of the `function` key of the `trendline_options` dict is the function to
use (defaults to `mean`) and the value of the `function_args` key are taken to be
its arguments as a dict. The remainder of  the `trendline_options` dict is passed as
keyword arguments into the `pandas.Series.expanding` function.
r   rR   rS   s          r2   r   r      s     ; 1!IIr3   c                     [        SXX65      $ )ak  Exponentially Weighted Moment (EWM) trendline function

The value of the `function` key of the `trendline_options` dict is the function to
use (defaults to `mean`) and the value of the `function_args` key are taken to be
its arguments as a dict. The remainder of  the `trendline_options` dict is passed as
keyword arguments into the `pandas.Series.ewm` function.
r   rR   rS   s          r2   r   r      s     5+ACCr3   N)__doc____all__r   r   rP   r   r   r   r?   r3   r2   <module>rX      s4    ;C,L%6%:HJDr3   