/usr/local/lib64/python3.6/site-packages/pyarrow/__pycache__
NameSizeModeActions
benchmark.cpython-36.pyc2080644editdlrm
cffi.cpython-36.pyc14820644editdlrm
compat.cpython-36.pyc3810644editdlrm
compute.cpython-36.pyc202630644editdlrm
csv.cpython-36.pyc3820644editdlrm
cuda.cpython-36.pyc4050644editdlrm
dataset.cpython-36.pyc279700644editdlrm
feather.cpython-36.pyc77390644editdlrm
filesystem.cpython-36.pyc144020644editdlrm
flight.cpython-36.pyc13530644editdlrm
fs.cpython-36.pyc103950644editdlrm
hdfs.cpython-36.pyc70550644editdlrm
ipc.cpython-36.pyc73940644editdlrm
json.cpython-36.pyc2310644editdlrm
jvm.cpython-36.pyc80350644editdlrm
orc.cpython-36.pyc51400644editdlrm
pandas_compat.cpython-36.pyc276950644editdlrm
parquet.cpython-36.pyc666090644editdlrm
plasma.cpython-36.pyc40690644editdlrm
serialization.cpython-36.pyc137370644editdlrm
types.cpython-36.pyc120830644editdlrm
util.cpython-36.pyc41500644editdlrm
_generated_version.cpython-36.pyc2230644editdlrm
__init__.cpython-36.pyc164760644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/pyarrow/__pycache__/compute.cpython-36.pyc (20263B)
3 9%Eg5Y@sddlmZmZmZmZmZmZmZmZm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4ddl5Z5ddl6m7Z7ddl8Z8ddl9Z:ddZ;ddZd d Z?ddZ@ddZAddZBeBd:ddZCddddZDddddZEddddZFdddd ZGddd!d"ZHddd#d$ZIddd%d&ZJd;ddd(d)d*ZKddd.d6d7ZPd?dd.d8d9ZQdS)@)4FunctionFunctionOptionsFunctionRegistryHashAggregateFunctionHashAggregateKernelKernelScalarAggregateFunctionScalarAggregateKernelScalarFunction ScalarKernelVectorFunction VectorKernelArraySortOptionsAssumeTimezoneOptions CastOptions CountOptionsDayOfWeekOptionsDictionaryEncodeOptionsElementWiseAggregateOptionsExtractRegexOptions FilterOptions IndexOptions JoinOptionsMakeStructOptionsMatchSubstringOptions ModeOptions NullOptions PadOptionsPartitionNthOptionsQuantileOptionsReplaceSliceOptionsReplaceSubstringOptions RoundOptionsRoundToMultipleOptionsScalarAggregateOptionsSelectKOptionsSetLookupOptions SliceOptions SortOptions SplitOptionsSplitPatternOptionsStrftimeOptionsStrptimeOptions TakeOptionsTDigestOptions TrimOptionsVarianceOptions WeekOptions call_functionfunction_registry get_functionlist_functionsN)dedentcCs|jjS)N)_doc arg_names)funcr:;/usr/local/lib64/python3.6/site-packages/pyarrow/compute.py_get_arg_namesRsr<cCs8t|j|jd|_||_||_g}|j}|j}|sR|jdkr@dnd}dj|j|}|j }t |} |j dj||r|j dj||j dx2| D]*} |j dkrd } nd } |j d j| | qW|j d|dk r|j dj|jt j|} x*| jjD]} |j dj| j|jqWdjdd|D|_|S)N)namearity argumentsargumentz,Call compute function {!r} with the given {}z {}. z{} z. Parameters ---------- vectorscalar_aggregatez Array-likezArray-like or scalar-likezM {} : {} Argument to compute function z memory_pool : pyarrow.MemoryPool, optional If not passed, will allocate memory from the default memory pool. z options : pyarrow.compute.{0}, optional Parameters altering compute function semantics. z {0} : optional Parameter for {1} constructor. Either `options` or `{0}` can be passed, but not both at the same time. css|]}t|VqdS)N)r6).0sr:r:r; sz-_decorate_compute_function..)rBrC)dictr=r>Z__arrow_compute_function____name__ __qualname__r7summaryformat descriptionr<appendkindinspect signature parametersvaluesjoin__doc__)wrapperZ exposed_namer9 option_classZ doc_piecesZcpp_docrKZarg_strrMr8Zarg_nameZarg_type options_sigpr:r:r;_decorate_compute_functionVsH       rZc CsF|jj}|sdSy t|Stk r@tjdj|tdSXdS)Nz!Python binding for {} not exposed)r7Z options_classglobalsKeyErrorwarningswarnrLRuntimeWarning)r9 class_namer:r:r;_get_options_classs  racCsh|r$|dkr|f|Stdj||dk rdt|tr@|f|St||rN|Stdj||t||S)NzSFunction {!r} called with both an 'options' argument and additional named argumentsz-Function {!r} expected a {} parameter, got {}) TypeErrorrL isinstancerHtype)r=rWoptionskwargsr:r:r;_handle_optionss    rgcs8dkrddfdd }ndddfdd }|S)N) memory_poolcsj|d|S)N)call)rhargs)r9r:r;rVsz&_make_generic_wrapper..wrapper)rhrecst||}j|||S)N)rgri)rhrerjrf)r9 func_namerWr:r;rVsr:)rkr9rWrVr:)r9rkrWr;_make_generic_wrappersrlcCsddlm}g}x|D]}|j|||jqWx|D]}|j|||jq6W|j|d|jdd|dk r|j|d|jddtj|}x&|jjD]}|j|j |jdqWtj |S)Nr) Parameterrh)defaultre)rO) rPrmrNPOSITIONAL_OR_KEYWORDVAR_POSITIONAL KEYWORD_ONLYrQrRrSreplace Signature)r8 var_arg_namesrWrmparamsr=rXrYr:r:r;_make_signatures        rvcCsdt|}t|}|o |djd}|r8|jjdg}ng}t|||}t||||_t||||S)Nr?*) rar< startswithpoplstriprlrv __signature__rZ)r=r9rWr8Z has_varargrtrVr:r:r;_wrap_functions r}cCsht}t}ddd}xL|jD]@}|j||}|j|}||ksJt|t||||<||<q WdS)z Make global functions wrapping each compute function. Note that some of the automatically-generated wrappers may be overriden by custom versions below. and_or_)andorN)r[r3r5getr4AssertionErrorr})gregZrewritesZcpp_namer=r9r:r:r;_make_global_functionss  rTcCs8|dkrtd|r tj|}n tj|}td|g|S)a Cast array values to another data type. Can also be invoked as an array instance method. Parameters ---------- arr : Array or ChunkedArray target_type : DataType or type string alias Type to cast to safe : bool, default True Check for overflows or other unsafe conversions 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')) [ 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]') [ 1262304000000, 1420070400000 ] >>> arr.cast('timestamp[ms]').type TimestampType(timestamp[ms]) Returns ------- casted : Array Nz!Cast target type must not be Nonecast) ValueErrorrsafeZunsafer2)ZarrZ target_typerrer:r:r;rs 1  rF) ignore_casecCstd|gt||dS)a Count the occurrences of substring *pattern* in each value of a string array. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray pattern : str pattern to search for exact matches ignore_case : bool, default False Ignore case while searching. Returns ------- result : pyarrow.Array or pyarrow.ChunkedArray count_substring)r)r2r)arraypatternrr:r:r;r8srcCstd|gt||dS)a Count the non-overlapping matches of regex *pattern* in each value of a string array. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray pattern : str pattern to search for exact matches ignore_case : bool, default False Ignore case while searching. Returns ------- result : pyarrow.Array or pyarrow.ChunkedArray count_substring_regex)r)r2r)rrrr:r:r;rNsrcCstd|gt||dS)a Find the index of the first occurrence of substring *pattern* in each value of a string array. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray pattern : str pattern to search for exact matches ignore_case : bool, default False Ignore case while searching. Returns ------- result : pyarrow.Array or pyarrow.ChunkedArray find_substring)r)r2r)rrrr:r:r;rdsrcCstd|gt||dS)a Find the index of the first match of regex *pattern* in each value of a string array. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray pattern : str regex pattern to search for ignore_case : bool, default False Ignore case while searching. Returns ------- result : pyarrow.Array or pyarrow.ChunkedArray find_substring_regex)r)r2r)rrrr:r:r;rzsrcCstd|gt||dS)aa Test if the SQL-style LIKE pattern *pattern* matches a value of a string array. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray pattern : str SQL-style LIKE pattern. '%' will match any number of characters, '_' will match exactly one character, and all other characters match themselves. To match a literal percent sign or underscore, precede the character with a backslash. ignore_case : bool, default False Ignore case while searching. Returns ------- result : pyarrow.Array or pyarrow.ChunkedArray match_like)r)r2r)rrrr:r:r;rsrcCstd|gt||dS)az Test if substring *pattern* is contained within a value of a string array. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray pattern : str pattern to search for exact matches ignore_case : bool, default False Ignore case while searching. Returns ------- result : pyarrow.Array or pyarrow.ChunkedArray match_substring)r)r2r)rrrr:r:r;rsrcCstd|gt||dS)an Test if regex *pattern* matches at any position a value of a string array. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray pattern : str regex pattern to search ignore_case : bool, default False Ignore case while searching. Returns ------- result : pyarrow.Array or pyarrow.ChunkedArray match_substring_regex)r)r2r)rrrr:r:r;rsrr?) skip_nulls min_countcCst|||d}td|g|S)a  Return top-n most common values and number of times they occur in a passed numerical (chunked) array, in descending order of occurrence. If there are multiple values with same count, the smaller one is returned first. Parameters ---------- array : pyarrow.Array or pyarrow.ChunkedArray n : int, default 1 Specify the top-n values. skip_nulls : bool, default True If True, ignore nulls in the input. Else return an empty array if any input is null. min_count : int, default 0 If there are fewer than this many values in the input, return an empty array. Returns ------- An array of structs Examples -------- >>> import pyarrow as pa >>> import pyarrow.compute as pc >>> arr = pa.array([1, 1, 2, 2, 3, 2, 2, 2]) >>> modes = pc.mode(arr, 2) >>> modes[0] >>> modes[1] )rrmode)rr2)rnrrrer:r:r;rs!rdropcCst|}td||g|S)a1 Select values (or records) from array- or table-like data given boolean filter, where true values are selected. Parameters ---------- data : Array, ChunkedArray, RecordBatch, or Table mask : Array, ChunkedArray Must be of boolean type null_selection_behavior : str, default 'drop' Configure the behavior on encountering a null slot in the mask. Allowed values are 'drop' and 'emit_null'. - 'drop': nulls will be treated as equivalent to False. - 'emit_null': nulls will result in a null in the output. Returns ------- result : depends on inputs Examples -------- >>> import pyarrow as pa >>> arr = pa.array(["a", "b", "c", None, "e"]) >>> mask = pa.array([True, False, None, False, True]) >>> arr.filter(mask) [ "a", "e" ] >>> arr.filter(mask, null_selection_behavior='emit_null') [ "a", null, "e" ] filter)rr2)datamaskZnull_selection_behaviorrer:r:r;rs(r)rhcCs|dk r.|dk r"|j|||}qB|j|}n|dk rB|jd|}t|tjs`tj||jd}n |j|jkrtj|j|jd}t|d}td|g||}|dk r|jdkrtj|j|tj d}|S)a Find the index of the first occurrence of a given value. Parameters ---------- data : Array or ChunkedArray value : Scalar-like object start : int, optional end : int, optional memory_pool : MemoryPool, optional If not passed, will allocate memory from the default memory pool. Returns ------- index : the index, or -1 if not found Nr)rd)valueindex) slicercpaScalarscalarrdas_pyrr2Zint64)rrstartendrhreresultr:r:r;r%s     r) boundscheckrhcCst|d}td||g||S)as 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 Examples -------- >>> import pyarrow as pa >>> arr = pa.array(["a", "b", "c", None, "e", "f"]) >>> indices = pa.array([0, None, 4, 3]) >>> arr.take(indices) [ "a", null, "e", null ] )rtake)r-r2)rindicesrrhrer:r:r;rIs' rcCsVt|tjtjtjfs(tj||jd}n |j|jkrHtj|j|jd}td||gS)a[ Replace each null element in values with fill_value. The fill_value must be the same type as values or 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 data will attempt to cast. Returns ------- result : depends on inputs 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 0x7f95437f01a0> [ 1, 2, 5, 3 ] )rdZcoalesce) rcrArray ChunkedArrayrrrdrr2)rSZ fill_valuer:r:r; fill_nullts " rcCsR|dkr g}t|tjtjfr*|jdntdd|}t||}td|g||S)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 of indices 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) [ 5, 4, 2 ] Ndummy descendingcSs|dfS)Nrr:)key_namer:r:r;sz top_k_unstable..select_k_unstable)rr)rcrrrrNmapr%r2)rSk sort_keysrhrer:r:r;top_k_unstables$  rcCsR|dkr g}t|tjtjfr*|jdntdd|}t||}td|g||S)a 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 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) [ 0, 1, 2 ] Nr ascendingcSs|dfS)Nrr:)rr:r:r;rsz#bottom_k_unstable..r)rr)rcrrrrNrr%r2)rSrrrhrer:r:r;bottom_k_unstables$  r)T)r?)r)NN)N)N)RZpyarrow._computerrrrrrrr r r r r rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5rPtextwrapr6r]Zpyarrowrr<rZrargrlrvr}rrrrrrrrrrrrrrrrr:r:r:r;s89 @   :% ,$+*.