
    'h_                        S SK Jr  S SKJr  S SKJr  \(       a  S SKJr  S SKJ	r	  S SK
JrJrJrJrJr  \ " S S5      5       rg	)
    )annotations)TYPE_CHECKING)expr_dispatch)Series)PySeries)
EndiannessIntoExprPolarsDataTypeSizeUnitTransferEncodingc                      \ rS rSrSrSrSS jrSS jrSS jrSS jr	SS	.SS
 jjr
SS jrSSS jjrSS.     SS jjrSrg)BinaryNameSpace   zSeries.bin namespace.binc                &    UR                   U l         g )N_s)selfseriess     gC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\polars/series/binary.py__init__BinaryNameSpace.__init__   s    "II    c                    g)a  
Check if binaries in Series contain a binary substring.

Parameters
----------
literal
    The binary substring to look for

Returns
-------
Series
    Series of data type :class:`Boolean`.

Examples
--------
>>> s = pl.Series("colors", [b"\x00\x00\x00", b"\xff\xff\x00", b"\x00\x00\xff"])
>>> s.bin.contains(b"\xff")
shape: (3,)
Series: 'colors' [bool]
[
    false
    true
    true
]
N )r   literals     r   containsBinaryNameSpace.contains       r   c                    g)a.  
Check if string values end with a binary substring.

Parameters
----------
suffix
    Suffix substring.

Examples
--------
>>> s = pl.Series("colors", [b"\x00\x00\x00", b"\xff\xff\x00", b"\x00\x00\xff"])
>>> s.bin.ends_with(b"\x00")
shape: (3,)
Series: 'colors' [bool]
[
    true
    true
    false
]
Nr   )r   suffixs     r   	ends_withBinaryNameSpace.ends_with7   r   r   c                    g)a+  
Check if values start with a binary substring.

Parameters
----------
prefix
    Prefix substring.

Examples
--------
>>> s = pl.Series("colors", [b"\x00\x00\x00", b"\xff\xff\x00", b"\x00\x00\xff"])
>>> s.bin.starts_with(b"\x00")
shape: (3,)
Series: 'colors' [bool]
[
    true
    false
    true
]
Nr   )r   prefixs     r   starts_withBinaryNameSpace.starts_withM   r   r   T)strictc                   g)a  
Decode values using the provided encoding.

Parameters
----------
encoding : {'hex', 'base64'}
    The encoding to use.
strict
    Raise an error if the underlying value cannot be decoded,
    otherwise mask out with a null value.

Returns
-------
Series
    Series of data type :class:`String`.

Examples
--------
Decode values using hexadecimal encoding.

>>> s = pl.Series("colors", [b"000000", b"ffff00", b"0000ff"])
>>> s.bin.decode("hex")
shape: (3,)
Series: 'colors' [binary]
[
    b"\x00\x00\x00"
    b"\xff\xff\x00"
    b"\x00\x00\xff"
]

Decode values using Base64 encoding.

>>> s = pl.Series("colors", [b"AAAA", b"//8A", b"AAD/"])
>>> s.bin.decode("base64")
shape: (3,)
Series: 'colors' [binary]
[
    b"\x00\x00\x00"
    b"\xff\xff\x00"
    b"\x00\x00\xff"
]

Set `strict=False` to set invalid values to null instead of raising an error.

>>> s = pl.Series("colors", [b"000000", b"ffff00", b"invalid_value"])
>>> s.bin.decode("hex", strict=False)
shape: (3,)
Series: 'colors' [binary]
[
    b"\x00\x00\x00"
    b"\xff\xff\x00"
    null
]
Nr   )r   encodingr(   s      r   decodeBinaryNameSpace.decodec   r   r   c                    g)a9  
Encode values using the provided encoding.

Parameters
----------
encoding : {'hex', 'base64'}
    The encoding to use.

Returns
-------
Series
    Series of data type :class:`String`.

Examples
--------
Encode values using hexadecimal encoding.

>>> s = pl.Series("colors", [b"\x00\x00\x00", b"\xff\xff\x00", b"\x00\x00\xff"])
>>> s.bin.encode("hex")
shape: (3,)
Series: 'colors' [str]
[
    "000000"
    "ffff00"
    "0000ff"
]

Encode values using Base64 encoding.

>>> s.bin.encode("base64")
shape: (3,)
Series: 'colors' [str]
[
    "AAAA"
    "//8A"
    "AAD/"
]
Nr   )r   r*   s     r   encodeBinaryNameSpace.encode   r   r   c                    g)aT  
Get the size of the binary values in a Series in the given unit.

Returns
-------
Series
    Series of data type :class:`UInt32`.

Examples
--------
>>> from os import urandom
>>> s = pl.Series("data", [urandom(n) for n in (512, 256, 2560, 1024)])
>>> s.bin.size("kb")
shape: (4,)
Series: 'data' [f64]
[
    0.5
    0.25
    2.5
    1.0
]
Nr   )r   units     r   sizeBinaryNameSpace.size   r   r   little)
endiannessc                   g)a  
Interpret bytes as another type.

Supported types are numerical or temporal dtypes, or an ``Array`` of
these dtypes.

Parameters
----------
dtype : PolarsDataType
    Which type to interpret binary column into.
endianness : {"big", "little"}, optional
    Which endianness to use when interpreting bytes, by default "little".

Returns
-------
Series
    Series of data type `dtype`.
    Note that rows of the binary array where the length does not match
    the size in bytes of the output array (number of items * byte size
    of item) will become NULL.

Examples
--------
>>> s = pl.Series("data", [b"\x05\x00\x00\x00", b"\x10\x00\x01\x00"])
>>> s.bin.reinterpret(dtype=pl.Int32, endianness="little")
shape: (2,)
Series: 'data' [i32]
[
    5
    65552
]

Nr   )r   dtyper5   s      r   reinterpretBinaryNameSpace.reinterpret   r   r   r   N)r   r   returnNone)r   r	   r:   r   )r!   r	   r:   r   )r%   r	   r:   r   )r*   r   r(   boolr:   r   )r*   r   r:   r   )b)r1   r   r:   r   )r7   r
   r5   r   r:   r   )__name__
__module____qualname____firstlineno____doc__	_accessorr   r   r"   r&   r+   r.   r2   r8   __static_attributes__r   r   r   r   r      s_    I&6,, DH 6p&P2 BJ#&#4>#	# #r   r   N)
__future__r   typingr   polars.series.utilsr   polarsr   polars._plrr   polars._typingr   r	   r
   r   r   r   r   r   r   <module>rK      s=    "   -$  j j jr   