
    chb                     n   S SK JrJrJrJrJrJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrN  S SKOJPrP  S SKQrQS SKRJSrS  S SKTrTS SKUrVS SKUJWrW  S SKXJYrY  S rZ\P" SS	5      r[S
 r\S r]S r^S r_S r`S raS rbS rc\c" 5         \d" 5       S   =rerfS!S jrgS"SS.S jjrhSSS.S jriS rjS#SS.S jjrkS#SS.S jjrlSSSS.S jrmS rnS  rog)$    )NFunctionFunctionOptionsFunctionRegistryHashAggregateFunctionHashAggregateKernelKernelScalarAggregateFunctionScalarAggregateKernelScalarFunctionScalarKernelVectorFunctionVectorKernelArraySortOptionsAssumeTimezoneOptionsCastOptionsCountOptionsCumulativeOptionsCumulativeSumOptionsDayOfWeekOptionsDictionaryEncodeOptionsRunEndEncodeOptionsElementWiseAggregateOptionsExtractRegexOptionsExtractRegexSpanOptionsFilterOptionsIndexOptionsJoinOptionsListSliceOptionsListFlattenOptionsMakeStructOptionsMapLookupOptionsMatchSubstringOptionsModeOptionsNullOptions
PadOptionsPairwiseOptionsPartitionNthOptionsPivotWiderOptionsQuantileOptionsRandomOptionsRankOptionsRankQuantileOptionsReplaceSliceOptionsReplaceSubstringOptionsRoundBinaryOptionsRoundOptionsRoundTemporalOptionsRoundToMultipleOptionsScalarAggregateOptionsSelectKOptionsSetLookupOptionsSkewOptionsSliceOptionsSortOptionsSplitOptionsSplitPatternOptionsStrftimeOptionsStrptimeOptionsStructFieldOptionsTakeOptionsTDigestOptionsTrimOptionsUtf8NormalizeOptionsVarianceOptionsWeekOptionsWinsorizeOptionsZeroFillOptionscall_functionfunction_registryget_functionlist_functionscall_tabular_functionregister_scalar_functionregister_tabular_functionregister_aggregate_functionregister_vector_function
UdfContext
Expression)
namedtupleN)dedent)_compute_docstrings)	docscrapec                 .    U R                   R                  $ N)_doc	arg_names)funcs    bC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\pyarrow/compute.py_get_arg_namesr[   q   s    99    _OptionsClassDoc)paramsc                     U R                   (       d  g [        R                  " U R                   5      n[        US   5      $ )N
Parameters)__doc__rT   NumpyDocStringr]   )options_classdocs     rZ   _scrape_options_class_docre   x   s4      

"
"=#8#8
9CC-..r\   c                    UR                   n[        UR                  UR                  UR                  UR
                  S9U l        Xl        Xl        / nUR                  nU(       d'  UR                  S:  a  SOSnSUR                  < SU 3nUR                  U S35        UR                  nU(       a  UR                  U S35        [        R                  R                  UR                  5      n	UR                  [        S	5      5        [!        U5      n
U
 H@  nUR"                  S
;   a  SnOSnUR                  U SU S35        UR                  S5        MB     UGbC  [%        U5      nU(       ag  UR&                   HV  nUR                  UR                   SUR(                   S35        UR*                   H  nUR                  SU S35        M     MX     O[,        R.                  " SUR                   S3[0        5        [2        R4                  " U5      nUR6                  R9                  5        HE  nUR                  [        SUR                   SUR                   SUR                   S35      5        MG     UR                  [        SUR                   S35      5        UR                  [        S5      5        U	b/  [        U	5      R;                  S5      nUR                  SU S35        SR=                  U5      U l        U $ )N)namearityrc   options_required   	argumentsargumentzCall compute function z with the given z.

z

z.        Parameters
        ----------
        )vectorscalar_aggregatez
Array-likezArray-like or scalar-likez : 
z"    Argument to compute function.
z    zOptions class z does not have a docstringz                z. : optional
                    Parameter for z7 constructor. Either `options`
                    or `z@` can be passed, but not both at the same time.
                z&            options : pyarrow.compute.zK, optional
                Alternative way of passing options.
            z        memory_pool : pyarrow.MemoryPool, optional
            If not passed, will allocate memory from the default memory pool.
         ) rW   dictrg   rh   rc   ri   __arrow_compute_function____name____qualname__summaryappenddescriptionrS   function_doc_additionsgetrR   r[   kindre   r^   typedescwarningswarnRuntimeWarninginspect	signature
parametersvaluesstripjoinra   )wrapperexposed_namerY   rc   cpp_doc
doc_piecesru   arg_strrw   doc_additionrX   arg_namearg_typeoptions_class_docpsoptions_sigstrippeds                     rZ   _decorate_compute_functionr      s    iiG)-YYjj++ 11	*3G&
 $'J ooG!%a+Z*499-7GyQ	'( %%K[M./&==AA$))LL f    t$I9966#H2HXJc(267?@   5mD&--!!QVVHCxr":;A%%QCrl3   .
 MMN=+A+A*B C6 78FH!++M:K ++224!!& . ##0#9#9": ; !* #  5 	& &''4'='=&> ?"  	
 f    ,'--d3Bxj+,ggj)GONr\   c                     U R                   R                  nU(       d  g  [        5       U   $ ! [         a"    [        R
                  " SU S3[        5         g f = f)NzPython binding for z not exposed)rW   rc   globalsKeyErrorr}   r~   r   )rY   
class_names     rZ   _get_options_classr      sV    ((Jy$$ +J<|D$	&s   - )AAc           
          U(       d  U(       a  Ub  [        SU < S35      eU" U0 UD6$ UbM  [        U[        5      (       a  U" S0 UD6$ [        X!5      (       a  U$ [        SU < SU S[        U5       35      eg )Nz	Function z@ called with both an 'options' argument and additional argumentsz expected a z parameter, got  )	TypeError
isinstancerq   r{   )rg   rc   optionsargskwargss        rZ   _handle_optionsr      s    vD8 $+ ,- - d-f--gt$$ +7++//Nx|M? ;=/#$ 	$ r\   c                 L   ^ ^^^ Tc  S S.UUU 4S jjnU$ S S S.UUU U4S jjnU$ )Nmemory_poolc           	        > T[         La,  [        U5      T:w  a  [        T ST S[        U5       S35      eU(       a8  [        US   [        5      (       a   [        R
                  " T[        U5      5      $ TR                  US U 5      $ )N takes  positional argument(s), but  were givenr   )Ellipsislenr   r   rP   _calllistcall)r   r   rh   rY   	func_names     rZ   r   &_make_generic_wrapper.<locals>.wrapper   s    H$Te); k 0t9+[2  
47J77!''	4:>>99T455r\   )r   r   c           	      H  > T[         La7  [        U5      T:  a  [        T ST S[        U5       S35      eUTS  nUS T nOSn[        TTUXC5      nU(       a9  [	        US   [
        5      (       a!  [
        R                  " T[        U5      U5      $ TR                  X!U 5      $ )Nr   r   r   r   r   )	r   r   r   r   r   rP   r   r   r   )	r   r   r   r   option_argsrh   rY   r   rc   s	        rZ   r   r      s    H$t9u$#$+WUG 4"4yk6  #56lFU| %i&1;G
47J77!''	4:wGG99TK88r\   r   )r   rY   rc   rh   r   s   ```` rZ   _make_generic_wrapperr      s5    '+ 	6 	64 N! (,T 	9 	9  Nr\   c                    SSK Jn  / nU  H$  nUR                  U" XSR                  5      5        M&     U H$  nUR                  U" XSR                  5      5        M&     Ub  [         R
                  " U5      nUR                  R                  5        H\  nUR                  UR                  UR                  4;   d   eU(       a  UR                  UR                  S9nUR                  U5        M^     UR                  U" SUR                  S S95        UR                  U" SUR                  S S95        [         R                  " U5      $ )Nr   )	Parameter)rz   r   )defaultr   )r   r   rv   POSITIONAL_ONLYVAR_POSITIONALr   r   r   rz   POSITIONAL_OR_KEYWORDKEYWORD_ONLYreplace	Signature)rX   var_arg_namesrc   r   r^   rg   r   r   s           rZ   _make_signaturer     s   !Fi&?&?@A i&>&>?@  ''6''..0A66i=='446 6 6 6II9#9#9I:MM! 1 	i	9+A+A(,. 	/
MM)M9+A+A$(* +V$$r\   c                    [        U5      n[        U5      nU=(       a    US   R                  S5      nU(       a!  UR                  5       R	                  S5      /nO/ n[        XX!R                  S9n[        X5U5      Ul        [        X`X5      $ )N*)rh   )
r   r[   
startswithpoplstripr   rh   r   __signature__r   )rg   rY   rc   rX   
has_varargr   r   s          rZ   _wrap_functionr   (  s    &t,Mt$I<y}77<J"//45#M5G+I,9;G%gTIIr\   c                  J   [        5       n [        5       nSSS.nUR                  5        Hv  nUR                  X35      nUR	                  U5      nUR
                  S:X  a  M7  UR
                  S:X  a  UR                  S:X  a  MY  X@;  d   U5       e[        XE5      =X'   X'   Mx     g)z
Make global functions wrapping each compute function.

Note that some of the automatically-generated wrappers may be overridden
by custom versions below.
and_or_)andorhash_aggregatern   r   N)r   rG   rI   ry   rH   rz   rh   r   )gregrewritescpp_namerg   rY   s         rZ   _make_global_functionsr   8  s     		A

C H &&(||H/)99(( 99**tzzQ }"d"} .t ::ag )r\   utf8_zero_fillc                 "   USL=(       d    USLnU(       a  Ub  [        S5      eUc[  [        R                  R                  R	                  U5      nUSL a  [
        R                  " U5      nO[
        R                  " U5      n[        SU /X45      $ )a  
Cast array values to another data type. Can also be invoked as an array
instance method.

Parameters
----------
arr : Array-like
target_type : DataType or str
    Type to cast to
safe : bool, default True
    Check for overflows or other unsafe conversions
options : CastOptions, default None
    Additional checks pass by CastOptions
memory_pool : MemoryPool, optional
    memory pool to use for allocations during function execution.

Examples
--------
>>> from datetime import datetime
>>> import pyarrow as pa
>>> arr = pa.array([datetime(2010, 1, 1), datetime(2015, 1, 1)])
>>> arr.type
TimestampType(timestamp[us])

You can use ``pyarrow.DataType`` objects to specify the target type:

>>> cast(arr, pa.timestamp('ms'))
<pyarrow.lib.TimestampArray object at ...>
[
  2010-01-01 00:00:00.000,
  2015-01-01 00:00:00.000
]

>>> cast(arr, pa.timestamp('ms')).type
TimestampType(timestamp[ms])

Alternatively, it is also supported to use the string aliases for these
types:

>>> arr.cast('timestamp[ms]')
<pyarrow.lib.TimestampArray object at ...>
[
  2010-01-01 00:00:00.000,
  2015-01-01 00:00:00.000
]
>>> arr.cast('timestamp[ms]').type
TimestampType(timestamp[ms])

Returns
-------
casted : Array
    The cast result as a new Array
NzRMust either pass values for 'target_type' and 'safe' or pass a value for 'options'Fcast)	
ValueErrorpatypeslibensure_typer   unsafesaferF   )arrtarget_typer   r   r   safe_vars_passeds         rZ   r   r   Z  s    l D(Fk.EW0 : ; 	; hhll..{;5=!((5G!&&{3G#==r\   r   c                b   Ub*  Ub  U R                  X#U-
  5      n O'U R                  U5      n OUb  U R                  SU5      n [        U[        R                  5      (       d  [        R                  " XR
                  S9nOGU R
                  UR
                  :w  a-  [        R                  " UR                  5       U R
                  S9n[        US9n[        SU /XT5      nUbM  UR                  5       S:  a9  [        R                  " UR                  5       U-   [        R                  " 5       S9nU$ )a  
Find the index of the first occurrence of a given value.

Parameters
----------
data : Array-like
value : Scalar-like object
    The value to search for.
start : int, optional
end : int, optional
memory_pool : MemoryPool, optional
    If not passed, will allocate memory from the default memory pool.

Returns
-------
index : int
    the index, or -1 if not found

Examples
--------
>>> import pyarrow as pa
>>> import pyarrow.compute as pc
>>> arr = pa.array(["Lorem", "ipsum", "dolor", "sit", "Lorem", "ipsum"])
>>> pc.index(arr, "ipsum")
<pyarrow.Int64Scalar: 1>
>>> pc.index(arr, "ipsum", start=2)
<pyarrow.Int64Scalar: 5>
>>> pc.index(arr, "amet")
<pyarrow.Int64Scalar: -1>
r   r{   valueindex)
slicer   r   Scalarscalarr{   as_pyr   rF   int64)datar   startendr   r   results          rZ   r   r     s    > ?::e5[1D::e$D	zz!S!eRYY''		%ii0	ejj	 		%++-dii8'G7TFGAFV\\^q06<<>E1
CMr\   T)boundscheckr   c                0    [        US9n[        SX/XC5      $ )a  
Select values (or records) from array- or table-like data given integer
selection indices.

The result will be of the same type(s) as the input, with elements taken
from the input array (or record batch / table fields) at the given
indices. If an index is null then the corresponding value in the output
will be null.

Parameters
----------
data : Array, ChunkedArray, RecordBatch, or Table
indices : Array, ChunkedArray
    Must be of integer type
boundscheck : boolean, default True
    Whether to boundscheck the indices. If False and there is an out of
    bounds index, will likely cause the process to crash.
memory_pool : MemoryPool, optional
    If not passed, will allocate memory from the default memory pool.

Returns
-------
result : depends on inputs
    Selected values for the given indices

Examples
--------
>>> import pyarrow as pa
>>> arr = pa.array(["a", "b", "c", None, "e", "f"])
>>> indices = pa.array([0, None, 4, 3])
>>> arr.take(indices)
<pyarrow.lib.StringArray object at ...>
[
  "a",
  null,
  "e",
  null
]
)r   take)r>   rF   )r   indicesr   r   r   s        rZ   r   r     s     P k2G$'GGr\   c                 d   [        U[        R                  [        R                  [        R                  45      (       d  [        R
                  " XR                  S9nOGU R                  UR                  :w  a-  [        R
                  " UR                  5       U R                  S9n[        SX/5      $ )a  Replace each null element in values with a corresponding
element from fill_value.

If fill_value is scalar-like, then every null element in values
will be replaced with fill_value. If fill_value is array-like,
then the i-th element in values will be replaced with the i-th
element in fill_value.

The fill_value's type must be the same as that of values, or it
must be able to be implicitly casted to the array's type.

This is an alias for :func:`coalesce`.

Parameters
----------
values : Array, ChunkedArray, or Scalar-like object
    Each null element is replaced with the corresponding value
    from fill_value.
fill_value : Array, ChunkedArray, or Scalar-like object
    If not same type as values, will attempt to cast.

Returns
-------
result : depends on inputs
    Values with all null elements replaced

Examples
--------
>>> import pyarrow as pa
>>> arr = pa.array([1, 2, None, 3], type=pa.int8())
>>> fill_value = pa.scalar(5, type=pa.int8())
>>> arr.fill_null(fill_value)
<pyarrow.lib.Int8Array object at ...>
[
  1,
  2,
  5,
  3
]
>>> arr = pa.array([1, 2, None, 4, None])
>>> arr.fill_null(pa.array([10, 20, 30, 40, 50]))
<pyarrow.lib.Int64Array object at ...>
[
  1,
  2,
  30,
  4,
  50
]
r   coalesce)	r   r   ArrayChunkedArrayr   r   r{   r   rF   )r   
fill_values     rZ   	fill_nullr     st    f j288R__bii"HIIYYz<
	
	'YYz//1D
f%9::r\   c                    Uc  / n[        U [        R                  [        R                  45      (       a  UR	                  S5        O[        S U5      n[        X5      n[        SU /XC5      $ )a<  
Select the indices of the top-k ordered elements from array- or table-like
data.

This is a specialization for :func:`select_k_unstable`. Output is not
guaranteed to be stable.

Parameters
----------
values : Array, ChunkedArray, RecordBatch, or Table
    Data to sort and get top indices from.
k : int
    The number of `k` elements to keep.
sort_keys : List-like
    Column key names to order by when input is table-like data.
memory_pool : MemoryPool, optional
    If not passed, will allocate memory from the default memory pool.

Returns
-------
result : Array
    Indices of the top-k ordered elements

Examples
--------
>>> import pyarrow as pa
>>> import pyarrow.compute as pc
>>> arr = pa.array(["a", "b", "c", None, "e", "f"])
>>> pc.top_k_unstable(arr, k=3)
<pyarrow.lib.UInt64Array object at ...>
[
  5,
  4,
  2
]
)dummy
descendingc                 
    U S4$ )Nr   r   key_names    rZ   <lambda> top_k_unstable.<locals>.<lambda>b  s	    (L)Ar\   select_k_unstabler   r   r   r   rv   mapr4   rF   r   k	sort_keysr   r   s        rZ   top_k_unstabler  8  sb    J 	&288R__56601A9M	Q*G,vhMMr\   c                    Uc  / n[        U [        R                  [        R                  45      (       a  UR	                  S5        O[        S U5      n[        X5      n[        SU /XC5      $ )aS  
Select the indices of the bottom-k ordered elements from
array- or table-like data.

This is a specialization for :func:`select_k_unstable`. Output is not
guaranteed to be stable.

Parameters
----------
values : Array, ChunkedArray, RecordBatch, or Table
    Data to sort and get bottom indices from.
k : int
    The number of `k` elements to keep.
sort_keys : List-like
    Column key names to order by when input is table-like data.
memory_pool : MemoryPool, optional
    If not passed, will allocate memory from the default memory pool.

Returns
-------
result : Array of indices
    Indices of the bottom-k ordered elements

Examples
--------
>>> import pyarrow as pa
>>> import pyarrow.compute as pc
>>> arr = pa.array(["a", "b", "c", None, "e", "f"])
>>> pc.bottom_k_unstable(arr, k=3)
<pyarrow.lib.UInt64Array object at ...>
[
  0,
  1,
  2
]
)r   	ascendingc                 
    U S4$ )Nr  r   r   s    rZ   r   #bottom_k_unstable.<locals>.<lambda>  s	    (K)@r\   r   r   r  s        rZ   bottom_k_unstabler	  g  sb    J 	&288R__566/0@)L	Q*G,vhMMr\   system)initializerr   r   c                ,    [        US9n[        S/ X#U S9$ )a  
Generate numbers in the range [0, 1).

Generated values are uniformly-distributed, double-precision
in range [0, 1). Algorithm and seed can be changed via RandomOptions.

Parameters
----------
n : int
    Number of values to generate, must be greater than or equal to 0
initializer : int or str
    How to initialize the underlying random generator.
    If an integer is given, it is used as a seed.
    If "system" is given, the random generator is initialized with
    a system-specific source of (hopefully true) randomness.
    Other values are invalid.
options : pyarrow.compute.RandomOptions, optional
    Alternative way of passing options.
memory_pool : pyarrow.MemoryPool, optional
    If not passed, will allocate memory from the default memory pool.
)r  random)length)r*   rF   )nr  r   r   s       rZ   r  r    s    , 4G2wAFFr\   c                  T   [        U 5      nUS:X  a  [        U S   [        [        45      (       a  [        R
                  " U S   5      $ [        U S   [        5      (       a  [        R                  " U S   5      $ [        S[        U S   5       35      e[        R                  " U 5      $ )a  Reference a column of the dataset.

Stores only the field's name. Type and other information is known only when
the expression is bound to a dataset having an explicit scheme.

Nested references are allowed by passing multiple names or a tuple of
names. For example ``('foo', 'bar')`` references the field named "bar"
inside the field named "foo".

Parameters
----------
*name_or_index : string, multiple strings, tuple or int
    The name or index of the (possibly nested) field the expression
    references to.

Returns
-------
field_expr : Expression
    Reference to the given field

Examples
--------
>>> import pyarrow.compute as pc
>>> pc.field("a")
<pyarrow.compute.Expression a>
>>> pc.field(1)
<pyarrow.compute.Expression FieldPath(1)>
>>> pc.field(("a", "b"))
<pyarrow.compute.Expression FieldRef.Nested(FieldRef.Name(a) ...
>>> pc.field("a", "b")
<pyarrow.compute.Expression FieldRef.Nested(FieldRef.Name(a) ...
rj   r   zCfield reference should be str, multiple str, tuple or integer, got )
r   r   strintrP   _fieldtuple_nested_fieldr   r{   )name_or_indexr  s     rZ   fieldr    s    B 	MAAvmA&c
33$$]1%566a(%00++M!,<==  $]1%5 679  ''66r\   c                 .    [         R                  " U 5      $ )a7  Expression representing a scalar value.

Creates an Expression object representing a scalar value that can be used
in compute expressions and predicates.

Parameters
----------
value : bool, int, float or string
    Python value of the scalar. This function accepts any value that can be
    converted to a ``pyarrow.Scalar`` using ``pa.scalar()``.

Notes
-----
This function differs from ``pyarrow.scalar()`` in the following way:

* ``pyarrow.scalar()`` creates a ``pyarrow.Scalar`` object that represents
  a single value in Arrow's memory model.
* ``pyarrow.compute.scalar()`` creates an ``Expression`` object representing
  a scalar value that can be used in compute expressions, predicates, and
  dataset filtering operations.

Returns
-------
scalar_expr : Expression
    An Expression representing the scalar value
)rP   _scalarr   s    rZ   r   r     s    6 e$$r\   )NNNN)NNrV   )ppyarrow._computer   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   collectionsrQ   r   textwraprR   r}   pyarrowr   rS   pyarrow.vendoredrT   r[   r]   re   r   r   r   r   r   r   r   r   
utf8_zfillr   r   r   r   r   r  r	  r  r  r   r   r\   rZ   <module>r      sO  $S S S S S S S S S S S S S S S S S S S Sj #     ' & 0+> /Pf	(>%.J ;:  %i(89 9
^B>J/D /d (, )HX8;v,NT ,N^,N ,N^ &t G4.7b%r\   