+
    nDj;_                        ^ RI HtHtHtHtHtHtHtHtH	t	H
t
HtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtHtH t H!t!H"t"H#t#H$t$H%t%H&t&H't'H(t(H)t)H*t*H+t+H,t,H-t-H.t.H/t/H0t0H1t1H2t2H3t3H4t4H5t5H6t6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t>H?t?H@t@HAtAHBtBHCtCHDtDHEtEHFtFHGtGHHtHHItIHJtJHKtKHLtLHMtMHNtNHOtOHPtP ^ RIQHRtR ^ RIStS^ RITHUtU ^ RIVtV^ RIWtX^ RIWHYtY ^ RIZH[t[ R t\]R! RR!4      t]R	 t^R
 t_R t`R taR tbR tcR tdR te]e! 4        ]f! 4       R,          ;tgthR"R ltiR#RR/R lltjRRRR/R ltkR tlR$RR/R lltmR$RR/R lltnRRRRRR/R ltoR tpR  tqR# )%    )P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InversePermutationOptionsJoinOptionsListSliceOptionsListFlattenOptionsMakeStructOptionsMapLookupOptionsMatchSubstringOptionsModeOptionsNullOptions
PadOptionsPairwiseOptionsPartitionNthOptionsPivotWiderOptionsQuantileOptionsRandomOptionsRankOptionsRankQuantileOptionsReplaceSliceOptionsReplaceSubstringOptionsRoundBinaryOptionsRoundOptionsRoundTemporalOptionsRoundToMultipleOptionsScalarAggregateOptionsScatterOptions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                 .    V P                   P                  # N)_doc	arg_names)funcs   &I/data/cameron/venvs/s3viz/lib/python3.14/site-packages/pyarrow/compute.py_get_arg_namesr]   s   s    99    _OptionsClassDocc                     V P                   '       g   R # \        P                  ! V P                   4      p\        VR,          4      # )N
Parameters)__doc__rV   NumpyDocStringr_   )options_classdocs   & r\   _scrape_options_class_docrf   z   s7       

"
"=#8#8
9CC-..r^   c                 $   VP                   p\        VP                  VP                  VP                  VP
                  R 7      V n        Wn        Wn        . pVP                  pV'       g)   VP                  ^8  d   RMRpRVP                  : RV 2pVP                  V R24       VP                  pV'       d   VP                  V R24       \        P                  P                  VP                  4      p	VP                  \        R4      4       \!        V4      p
V
 FA  pVP"                  R9   d   RpMR	pVP                  V R
V R24       VP                  R4       KC  	  VEeE   \%        V4      pV'       dh   VP&                   FV  pVP                  VP                   R
VP(                   R24       VP*                   F  pVP                  RV R24       K  	  KX  	  M\,        P.                  ! RVP                   R2\0        4       \2        P4                  ! V4      pVP6                  P9                  4        FE  pVP                  \        RVP                   RVP                   RVP                   R24      4       KG  	  VP                  \        RVP                   R24      4       VP                  \        R4      4       V	e0   \        V	4      P;                  R4      pVP                  RV R24       RP=                  V4      V n        V # ))namearityrd   options_required	argumentsargumentzCall compute function z with the given z.

z

z.        Parameters
        ----------
        z
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.
         )vectorscalar_aggregate) rY   dictrh   ri   rd   rj   __arrow_compute_function____name____qualname__summaryappenddescriptionrU   function_doc_additionsgetrT   r]   kindrf   paramstypedescwarningswarnRuntimeWarninginspect	signature
parametersvaluesstripjoinrb   )wrapperexposed_namer[   rd   cpp_doc
doc_piecesru   arg_strrw   doc_additionrZ   arg_namearg_typeoptions_class_docpsoptions_sigstrippeds   &&&&              r\   _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                     V P                   P                  pV'       g   R #  \        4       V,          #   \         d$    \        P
                  ! RT R2\        4        R # i ; i)NzPython binding for z not exposed)rY   rd   globalsKeyErrorr~   r   r   )r[   
class_names   & r\   _get_options_classr      sV    ((Jy$$ +J<|D$	&s   3 *A! A!c           
         V'       g	   V'       d   Ve   \        RV : R24      hV! V/ VB # VeP   \        V\        4      '       d	   V! R/ VB # \        W!4      '       d   V# \        RV : RV R\        V4       24      hR # )Nz	Function z@ called with both an 'options' argument and additional argumentsz expected a z parameter, got  )	TypeError
isinstancerq   r|   )rh   rd   optionsargskwargss   &&&&&r\   _handle_optionsr      s    vD8 $+ ,- - d-f--gt$$ +7++//Nx|M? ;=/#$ 	$ r^   c                 P   a aaa Sf   RR /VVV 3R llpV# RR RR /VVV V3R llpV# )Nmemory_poolc           	      "  < S\         Jd.   \        V4      S8w  d   \        S R S R\        V4       R24      hV'       d>   \        V^ ,          \        4      '       d!   \        P
                  ! S\        V4      4      # SP                  VRV 4      # ) takes  positional argument(s), but  were givenN)Ellipsislenr   r   rR   _calllistcall)r   r   ri   r[   	func_names   $*r\   r   &_make_generic_wrapper.<locals>.wrapper   s    H$Te); k 0t9+[2  
47J77!''	4:>>99T455r^   r   c           	      X  < S\         Jd9   \        V4      S8  d   \        S R S R\        V4       R24      hVSR pVRS pMRp\        SSVWC4      pV'       d?   \	        V^ ,          \
        4      '       d"   \
        P                  ! S\        V4      V4      # SP                  W!V 4      # )r   r   r   Nr   )	r   r   r   r   r   rR   r   r   r   )	r   r   r   r   option_argsri   r[   r   rd   s	   $$*, r\   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   r[   rd   ri   r   s   ffff r\   _make_generic_wrapperr      s@    	6t 	6 	64 N!	9t 	9T 	9 	9  Nr^   c                    ^ RI Hp . pV  F$  pVP                  V! WSP                  4      4       K&  	  V F$  pVP                  V! WSP                  4      4       K&  	  Ve   \         P
                  ! V4      pVP                  P                  4        Fa  pVP                  VP                  VP                  39   g   Q hV'       d   VP                  VP                  R7      pVP                  V4       Kc  	  VP                  V! RVP                  RR7      4       VP                  V! RVP                  RR7      4       \         P                  ! V4      # )r   )	ParameterN)rz   r   )defaultr   )r   r   rv   POSITIONAL_ONLYVAR_POSITIONALr   r   r   rz   POSITIONAL_OR_KEYWORDKEYWORD_ONLYreplace	Signature)rZ   var_arg_namesrd   r   r{   rh   r   r   s   &&&     r\   _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                 0   \        V4      p\        V4      pT;'       d    VR,          P                  R4      pV'       d"   VP                  4       P	                  R4      .pM. p\        WW!P                  R7      p\        W5V4      Vn        \        W`W4      # )   *)ri   )
r   r]   
startswithpoplstripr   ri   r   __signature__r   )rh   r[   rd   rZ   
has_varargr   r   s   &&     r\   _wrap_functionr   *  s    &t,Mt$I<<y}77<J"//45#M5G+I,9;G%gTIIr^   c                 V   \        4       p \        4       pRRRR/pVP                  4        Fz  pVP                  W34      pVP	                  V4      pVP
                  R8X  d   K8  VP
                  R8X  d   VP                  ^ 8X  d   K\  W@9  g   Q V4       h\        WE4      ;W&   W&   K|  	  R# )z
Make global functions wrapping each compute function.

Note that some of the automatically-generated wrappers may be overridden
by custom versions below.
andand_oror_hash_aggregaterp   N)r   rI   rK   ry   rJ   rz   ri   r   )gregrewritescpp_namerh   r[   s         r\   _make_global_functionsr   :  s     		A

C veH &&(||H/)99(( 99**tzzQ }"d"} .t ::ag )r^   utf8_zero_fillc                ,   VRJ;'       g    VRJpV'       d   Ve   \        R4      hVf]   \        P                  P                  P	                  V4      pVRJ d   \
        P                  ! V4      pM\
        P                  ! V4      p\        RV .W44      # )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saferH   )arrtarget_typer   r   r   safe_vars_passeds   &&&&& r\   r   r   \  s    l D(FFk.EW0 : ; 	; hhll..{;5=!((5G!&&{3G#==r^   r   c                  Ve0   Ve   V P                  W#V,
          4      p M(V P                  V4      p MVe   V P                  ^ V4      p \        V\        P                  4      '       g#   \        P                  ! WP
                  R7      pMKV P
                  VP
                  8w  d1   \        P                  ! VP                  4       V P
                  R7      p\        VR7      p\        RV .WT4      pVeV   VP                  4       ^ 8  dA   \        P                  ! VP                  4       V,           \        P                  ! 4       R7      pV# )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|   valueindex)
slicer   r   Scalarscalarr|   as_pyr   rH   int64)datar   startendr   r   results   &&&&$  r\   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^   boundscheckTc               6    \        VR7      p\        RW.WC4      # )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@   rH   )r   indicesr   r   r   s   &&$$ r\   r   r     s     P k2G$'GGr^   c                t   \        V\        P                  \        P                  \        P                  34      '       g#   \        P
                  ! WP                  R7      pMKV P                  VP                  8w  d1   \        P
                  ! VP                  4       V P                  R7      p\        RW.4      # )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   rH   )r   
fill_values   &&r\   	fill_nullr     st    f j288R__bii"HIIYYz<
	
	'YYz//1D
f%9::r^   c                   Vf   . p\        V \        P                  \        P                  34      '       d   VP	                  R4       M\        R V4      p\        W4      p\        RV .WC4      # )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
]
c                 
    V R 3# )
descendingr   key_names   &r\   <lambda> top_k_unstable.<locals>.<lambda>d  s	    (L)Ar^   select_k_unstable)dummyr   r   r   r   r   rv   mapr6   rH   r   k	sort_keysr   r   s   &&&$ r\   top_k_unstabler  :  sb    J 	&288R__56601A9M	Q*G,vhMMr^   c                   Vf   . p\        V \        P                  \        P                  34      '       d   VP	                  R4       M\        R V4      p\        W4      p\        RV .WC4      # )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
]
c                 
    V R 3# )	ascendingr   r   s   &r\   r   #bottom_k_unstable.<locals>.<lambda>  s	    (K)@r^   r   )r   r  r   r  s   &&&$ r\   bottom_k_unstabler
  i  sb    J 	&288R__566/0@)L	Q*G,vhMMr^   initializersystemr   c               8    \        VR7      p\        R. W#V R7      # )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+   rH   )nr  r   r   s   &$$$r\   r  r    s    , 4G2wAFFr^   c                    \        V 4      pV^8X  d   \        V ^ ,          \        \        34      '       d   \        P
                  ! V ^ ,          4      # \        V ^ ,          \        4      '       d   \        P                  ! V ^ ,          4      # \        R\        V ^ ,          4       24      h\        P                  ! V 4      # )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) ...
zCfield reference should be str, multiple str, tuple or integer, got )
r   r   strintrR   _fieldtuple_nested_fieldr   r|   )name_or_indexr  s   * r\   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                .    \         P                  ! V 4      # )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
)rR   _scalarr   s   &r\   r   r     s    6 e$$r^   )r{   )NNNN)NNrX   )r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   rQ   rR   collectionsrS   r   textwraprT   r~   pyarrowr   rU   pyarrow.vendoredrV   r]   r_   rf   r   r   r   r   r   r   r   r   
utf8_zfillr   r   r   r   r   r  r
  r  r  r   r   r^   r\   <module>r!     sm  $U U U U U U U U U U U U U U U U U U U U Un #     ' & 0+> /Pf	(>%.J ;:  %i(89 9
^B>J/D /d)Ht )H )HX8;v,NT ,N^,N ,N^GX Gt G G4.7b%r^   