zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
U
¬ý°d¾ã@sbddlmZddlZddlZddlZddlmZddlm    Z    ddddœdd    „Z
d
d d œd d„Z dS)é)Ú annotationsN)ÚPerformanceWarning)Úfind_stack_levelz
str | NoneÚNone)ÚversionÚreturncCs2d}|dk    r|d|›d7}tj|ttƒddS)z`
    Raise a PerformanceWarning for falling back to ExtensionArray's
    non-pyarrow method
    zGFalling back on a non-pyarrow code path which may decrease performance.Nz Upgrade to pyarrow >=z# to possibly suppress this warning.)Ú
stacklevel)ÚwarningsÚwarnrr)rÚmsg©r ú\d:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/core/arrays/arrow/_arrow_utils.pyÚfallback_performancewarning srznp.dtypeztuple[np.ndarray, np.ndarray])Údtyperc    Cs¦t |¡}| ¡}|j|j}t|ƒ|j}|d|||…}tj||d}|d}|dk    rŒtjj    t 
¡t|ƒd|g|jd}t  |¡}ntj t|ƒt d}||fS)aµ
    Convert a primitive pyarrow.Array to a numpy array and boolean mask based
    on the buffers of the Array.
 
    At the moment pyarrow.BooleanArray is not supported.
 
    Parameters
    ----------
    arr : pyarrow.Array
    dtype : numpy.dtype
 
    Returns
    -------
    (data, mask)
        Tuple of two numpy arrays with the raw data (with specified dtype) and
        a boolean mask (validity mask, so False means missing)
    é)rrN)Úoffset)ÚnprÚbuffersrÚitemsizeÚlenZ
frombufferÚpyarrowZ BooleanArrayZ from_buffersZbool_ZasarrayZonesÚbool)    ZarrrZbuflistrÚlengthZdata_bufÚdataZbitmaskÚmaskr r r Úpyarrow_array_to_numpy_and_masks"
 ÿ r)N) Ú
__future__rr    ÚnumpyrrZ pandas.errorsrZpandas.util._exceptionsrrrr r r r Ú<module>s