ó
    à'·hh  ã                  óF  • S SK Jr  S SKrS SKJr  S SKJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  \R                  " \5         S SKJr  SSS5        \(       a  S S	KJr  S S
KJr  S SKJr  \" 5       \" SS/SS9  S         SS jj5       5       rg! , (       d  f       NP= f)é    )ÚannotationsN)Údate)ÚTYPE_CHECKING)Údeprecate_nonkeyword_arguments)Úparse_into_expression)Úunstable)Ú	wrap_expr)ÚIterable)ÚExpr)ÚIntoExprColumnÚstartÚendz1.27.0)Úallowed_argsÚversionc                óâ   • [        U 5      n[        U5      n[        SSS5      n[        [        R                  " UU[        U5      U Vs/ s H  owU-
  R                  PM     sn5      5      $ s  snf )uÂ  
Count the number of business days between `start` and `end` (not including `end`).

.. warning::
    This functionality is considered **unstable**. It may be changed
    at any point without it being considered a breaking change.

.. versionchanged:: 1.27.0
    Parameters after `start` and `end` should now be passed as keyword arguments.

Parameters
----------
start
    Start dates.
end
    End dates.
week_mask
    Which days of the week to count. The default is Monday to Friday.
    If you wanted to count only Monday to Thursday, you would pass
    `(True, True, True, True, False, False, False)`.
holidays
    Holidays to exclude from the count. The Python package
    `python-holidays <https://github.com/vacanza/python-holidays>`_
    may come in handy here. You can install it with ``pip install holidays``,
    and then, to get all Dutch holidays for years 2020-2024:

    .. code-block:: python

        import holidays

        my_holidays = holidays.country_holidays("NL", years=range(2020, 2025))

    and pass `holidays=my_holidays` when you call `business_day_count`.

Returns
-------
Expr

Examples
--------
>>> from datetime import date
>>> df = pl.DataFrame(
...     {
...         "start": [date(2020, 1, 1), date(2020, 1, 2)],
...         "end": [date(2020, 1, 2), date(2020, 1, 10)],
...     }
... )
>>> df.with_columns(
...     business_day_count=pl.business_day_count("start", "end"),
... )
shape: (2, 3)
â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
â”‚ start      â”† end        â”† business_day_count â”‚
â”‚ ---        â”† ---        â”† ---                â”‚
â”‚ date       â”† date       â”† i32                â”‚
â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
â”‚ 2020-01-01 â”† 2020-01-02 â”† 1                  â”‚
â”‚ 2020-01-02 â”† 2020-01-10 â”† 6                  â”‚
â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

Note how the business day count is 6 (as opposed a regular day count of 8)
due to the weekend (2020-01-04 - 2020-01-05) not being counted.

You can pass a custom weekend - for example, if you only take Sunday off:

>>> week_mask = (True, True, True, True, True, True, False)
>>> df.with_columns(
...     business_day_count=pl.business_day_count(
...         "start", "end", week_mask=week_mask
...     ),
... )
shape: (2, 3)
â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
â”‚ start      â”† end        â”† business_day_count â”‚
â”‚ ---        â”† ---        â”† ---                â”‚
â”‚ date       â”† date       â”† i32                â”‚
â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
â”‚ 2020-01-01 â”† 2020-01-02 â”† 1                  â”‚
â”‚ 2020-01-02 â”† 2020-01-10 â”† 7                  â”‚
â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜

You can also pass a list of holidays to exclude from the count:

>>> from datetime import date
>>> holidays = [date(2020, 1, 1), date(2020, 1, 2)]
>>> df.with_columns(
...     business_day_count=pl.business_day_count("start", "end", holidays=holidays)
... )
shape: (2, 3)
â”Œâ”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”¬â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”
â”‚ start      â”† end        â”† business_day_count â”‚
â”‚ ---        â”† ---        â”† ---                â”‚
â”‚ date       â”† date       â”† i32                â”‚
â•žâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•ªâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¡
â”‚ 2020-01-01 â”† 2020-01-02 â”† 0                  â”‚
â”‚ 2020-01-02 â”† 2020-01-10 â”† 5                  â”‚
â””â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”´â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”˜
i²  é   )r   r   r	   ÚplrÚbusiness_day_countÚlistÚdays)r   r   Ú	week_maskÚholidaysÚstart_pyexprÚ
end_pyexprÚ
unix_epochÚholidays           ÚlC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\polars/functions/business.pyr   r      sp   € ôT )¨Ó/€LÜ& sÓ+€JÜd˜A˜qÓ!€JÜÜ×ÒØØÜ‹OÙ8@ÓAº¨W˜
Ñ"×(Ô(¹ÑAó		
óð ùò
 Bs   Á	A,))TTTTTFF© )
r   údate | IntoExprColumnr   r   r   zIterable[bool]r   zIterable[date]Úreturnr   )Ú
__future__r   Ú
contextlibÚdatetimer   Útypingr   Úpolars._utils.deprecationr   Úpolars._utils.parser   Úpolars._utils.unstabler   Úpolars._utils.wrapr	   ÚsuppressÚImportErrorÚpolars._plrÚ_plrr   Úcollections.abcr
   Úpolarsr   Úpolars._typingr   r   r   ó    r   Ú<module>r1      s³   ðÝ "ã Ý Ý  å DÝ 5Ý +Ý (à×Ò˜Õ%Ý÷ &ö Ý(åÝ-ñ 
ƒÙ¨g°uÐ-=ÀxÑPð !MØ!ð	rØ ðrà	ðrð ðrð ð	rð
 
ôró Qó ñr÷ &Õ%ús   ÁBÂ
B 