
    Khh                        S r SSKrSSKrSSKJrJrJrJrJrJ	r	J
r
Jr  SSKJr  SSKJr  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/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:  S r;\;" 5         / SQr<\Rz                  " \R|                  5      R~                  r@S	 rAS
 rBS rC\" S5      S 5       r\" S5      S 5       rD\" S5      S-S j5       r\" S5      S-S j5       r\" S5      S-S j5       r \" S5      S-S j5       r"\" S5      S-S j5       r$\" S5      S-S j5       r&\" S5      S-S j5       r(\" S5      S.S j5       rE\" S5      S.S j5       rF\" S5      S/S j5       rG\" S5      S0S j5       rH\" S5      S0S j5       rI\" S5      S0S j5       rJ\" S5      S 5       rK\" S5      S1S j5       rL\" S5      S1S j5       rM\" S5      S1S j5       rN\" S5      S  5       rO\" S5      S! 5       rP\" S5      S" 5       rQ\" S5      S# 5       rR\" S5      S$ 5       rS\" S5      S2S% j5       rTS& rUS.S' jrVS.S( jrWS1S) jrX\" S5      S* 5       rY\" S5      S+ 5       rZ\" S5      S1S, j5       r[g)3zK
This module contains a set of functions for vectorized string
operations.
    N)equal	not_equalless
less_equalgreatergreater_equaladdmultiply)_vec_string)
set_module)"isalphaisdigitisspaceisalnumislowerisupperistitle	isdecimal	isnumericstr_lenfindrfindindexrindexcount
startswithendswith_lstrip_whitespace_lstrip_chars_rstrip_whitespace_rstrip_chars_strip_whitespace_strip_chars_replace_expandtabs_length_expandtabs_center_ljust_rjust_zfill
_partition_partition_index_rpartition_rpartition_indexc            
          [         [        [        [        [        [
        [        [        [        [        4
 H  n SU l
        U R                  U l        M     g )Nnumpy.strings)r   r   r   r   r   r   r   r   r   r   
__module____name____qualname__)ufuncs    E/var/www/html/env/lib/python3.13/site-packages/numpy/_core/strings.py_override___module__r6   4   s:    )Wgy'' +"^^    )-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   lstriprstripstripreplace
expandtabscenterljustrjustzfill	partition
rpartitionupperlowerswapcase
capitalizetitlemoddecodeencode	translatec                     [        U R                  R                  [        R                  5      (       a  U R
                  S-  $ U R
                  $ )z
Helper function that returns the number of characters per field in
a string or unicode array.  This is to abstract out the fact that
for a unicode array this is itemsize / 4.
   )
issubclassdtypetypenpstr_itemsize)as    r5   _get_num_charsrU   W   s5     !'',,((zzQ::r7   c                    [         R                  " U5      nU R                  S:X  a  U R                  UR                  5      $ [         R                  " U R                  5       5      n[        UR                  [         R                  R                  5      (       a$  UR                  [        UR                  5      5      $ UR                  [        UR                  5      " [        U5      5      5      $ )z
Helper function to cast a result back into an array
with the appropriate dtype if an object array must be used
as an intermediary.
r   )rQ   asarraysizeastyperO   tolist
isinstancedtypesStringDTyperP   rU   )resultoutput_dtype_likerets      r5   _to_bytes_or_str_arrayra   b   s     

#45{{a }}.4455
**V]]_
%C#))299+@+@AAzz$066788::d,223N34GHIIr7   c                  J    / nU  H  nUc    U$ UR                  U5        M     U$ )a	  
Helper function for delegating arguments to Python string
functions.

Many of the Python string operations that have optional arguments
do not use 'None' to indicate a default value.  In these cases,
we need to remove all None arguments, and those following them.
)append)argsnewargschks      r5   _clean_argsrg   s   s5     G;N 	s  Nr7   r0   c                    [         R                  " U 5      n [         R                  " U5      n[         R                  " UR                  [         R                  5      (       d  [        SUR                   S35      e[         R                  " US5      nU R                  R                  S:X  a  X-  $ [        U 5      n[         R                  " U[        R                  [         R                  " US5      -  :  5      (       a  [        S5      eX!-  nU R                  R                   UR                  5        3n[         R                  " XR                  US9n[!        XUS9$ )	a  
Return (a * i), that is string multiple concatenation,
element-wise.

Values in ``i`` of less than 0 are treated as 0 (which yields an
empty string).

Parameters
----------
a : array_like, with ``StringDType``, ``bytes_`` or ``str_`` dtype

i : array_like, with any integer dtype

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

Examples
--------
>>> import numpy as np
>>> a = np.array(["a", "b", "c"])
>>> np.strings.multiply(a, 3)
array(['aaa', 'bbb', 'ccc'], dtype='<U3')
>>> i = np.array([1, 2, 3])
>>> np.strings.multiply(a, i)
array(['a', 'bb', 'ccc'], dtype='<U3')
>>> np.strings.multiply(np.array(['a']), i)
array(['a', 'aa', 'aaa'], dtype='<U3')
>>> a = np.array(['a', 'b', 'c', 'd', 'e', 'f']).reshape((2, 3))
>>> np.strings.multiply(a, 3)
array([['aaa', 'bbb', 'ccc'],
       ['ddd', 'eee', 'fff']], dtype='<U3')
>>> np.strings.multiply(a, i)
array([['a', 'bb', 'ccc'],
       ['d', 'ee', 'fff']], dtype='<U3')

unsupported type z for operand 'i'r   T   zrepeated string is too longshaperO   out)rQ   
asanyarray
issubdtyperO   integer	TypeErrormaximumcharr   anysysmaxsizeMemoryErrormax
empty_likerm   _multiply_ufunc)rT   ia_lenbuffersizes	out_dtypero   s         r5   r
   r
      s   R 	aA
aA=="**--+AGG94DEFF


1aA 	ww||suAJE 
vveckkBJJq!$44455788)K77<<.!2 34I
--!2!2)
DC1S))r7   c                 P    [        [        U [        R                  SU45      U 5      $ )a  
Return (a % i), that is pre-Python 2.6 string formatting
(interpolation), element-wise for a pair of array_likes of str
or unicode.

Parameters
----------
a : array_like, with `np.bytes_` or `np.str_` dtype

values : array_like of values
   These values will be element-wise interpolated into the string.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

Examples
--------
>>> import numpy as np
>>> a = np.array(["NumPy is a %s library"])
>>> np.strings.mod(a, values=["Python"])
array(['NumPy is a Python library'], dtype='<U25')

>>> a = np.array([b'%d bytes', b'%d bits'])
>>> values = np.array([8, 64])
>>> np.strings.mod(a, values)
array([b'8 bytes', b'64 bits'], dtype='|S7')

__mod__ra   r   rQ   object_)rT   valuess     r5   rH   rH      s(    B "Arzz9vi8!= =r7   c                 0    Ub  UO[         n[        XX#5      $ )a  
For each element, return the lowest index in the string where
substring ``sub`` is found, such that ``sub`` is contained in the
range [``start``, ``end``).

Parameters
----------
a : array_like, with ``StringDType``, ``bytes_`` or ``str_`` dtype

sub : array_like, with `np.bytes_` or `np.str_` dtype
    The substring to search for.

start, end : array_like, with any integer dtype
    The range to look in, interpreted as in slice notation.

Returns
-------
y : ndarray
    Output array of ints

See Also
--------
str.find

Examples
--------
>>> import numpy as np
>>> a = np.array(["NumPy is a Python library"])
>>> np.strings.find(a, "Python")
array([11])

)MAX_find_ufuncrT   substartends       r5   r   r      s    D #cCqu**r7   c                 0    Ub  UO[         n[        XX#5      $ )ai  
For each element, return the highest index in the string where
substring ``sub`` is found, such that ``sub`` is contained in the
range [``start``, ``end``).

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

sub : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    The substring to search for.

start, end : array_like, with any integer dtype
    The range to look in, interpreted as in slice notation.

Returns
-------
y : ndarray
    Output array of ints

See Also
--------
str.rfind

Examples
--------
>>> import numpy as np
>>> a = np.array(["Computer Science"])
>>> np.strings.rfind(a, "Science", start=0, end=None)
array([9])
>>> np.strings.rfind(a, "Science", start=0, end=8)
array([-1])
>>> b = np.array(["Computer Science", "Science"])
>>> np.strings.rfind(b, "Science", start=0, end=None)
array([9, 0])

)r   _rfind_ufuncr   s       r5   r   r     s    N #cC++r7   c                 0    Ub  UO[         n[        XX#5      $ )a  
Like `find`, but raises :exc:`ValueError` when the substring is not found.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

sub : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

start, end : array_like, with any integer dtype, optional

Returns
-------
out : ndarray
    Output array of ints.

See Also
--------
find, str.index

Examples
--------
>>> import numpy as np
>>> a = np.array(["Computer Science"])
>>> np.strings.index(a, "Science", start=0, end=None)
array([9])

)r   _index_ufuncr   s       r5   r   r   :  s    < #cC++r7   c                 0    Ub  UO[         n[        XX#5      $ )a  
Like `rfind`, but raises :exc:`ValueError` when the substring `sub` is
not found.

Parameters
----------
a : array-like, with `np.bytes_` or `np.str_` dtype

sub : array-like, with `np.bytes_` or `np.str_` dtype

start, end : array-like, with any integer dtype, optional

Returns
-------
out : ndarray
    Output array of ints.

See Also
--------
rfind, str.rindex

Examples
--------
>>> a = np.array(["Computer Science"])
>>> np.strings.rindex(a, "Science", start=0, end=None)
array([9])

)r   _rindex_ufuncr   s       r5   r   r   \  s    < #cC,,r7   c                 0    Ub  UO[         n[        XX#5      $ )ak  
Returns an array with the number of non-overlapping occurrences of
substring ``sub`` in the range [``start``, ``end``).

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

sub : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
   The substring to search for.

start, end : array_like, with any integer dtype
    The range to look in, interpreted as in slice notation.

Returns
-------
y : ndarray
    Output array of ints

See Also
--------
str.count

Examples
--------
>>> import numpy as np
>>> c = np.array(['aAaAaA', '  aA  ', 'abBABba'])
>>> c
array(['aAaAaA', '  aA  ', 'abBABba'], dtype='<U7')
>>> np.strings.count(c, 'A')
array([3, 1, 1])
>>> np.strings.count(c, 'aA')
array([3, 1, 0])
>>> np.strings.count(c, 'A', start=1, end=4)
array([2, 1, 1])
>>> np.strings.count(c, 'A', start=1, end=3)
array([1, 0, 0])

)r   _count_ufuncr   s       r5   r   r   ~  s    R #cC++r7   c                 0    Ub  UO[         n[        XX#5      $ )a  
Returns a boolean array which is `True` where the string element
in ``a`` starts with ``prefix``, otherwise `False`.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

prefix : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

start, end : array_like, with any integer dtype
    With ``start``, test beginning at that position. With ``end``,
    stop comparing at that position.

Returns
-------
out : ndarray
    Output array of bools

See Also
--------
str.startswith

Examples
--------
>>> import numpy as np
>>> s = np.array(['foo', 'bar'])
>>> s
array(['foo', 'bar'], dtype='<U3')
>>> np.strings.startswith(s, 'fo')
array([True,  False])
>>> np.strings.startswith(s, 'o', start=1, end=2)
array([True,  False])

)r   _startswith_ufunc)rT   prefixr   r   s       r5   r   r     s    J #cCQ33r7   c                 0    Ub  UO[         n[        XX#5      $ )a  
Returns a boolean array which is `True` where the string element
in ``a`` ends with ``suffix``, otherwise `False`.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

suffix : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

start, end : array_like, with any integer dtype
    With ``start``, test beginning at that position. With ``end``,
    stop comparing at that position.

Returns
-------
out : ndarray
    Output array of bools

See Also
--------
str.endswith

Examples
--------
>>> import numpy as np
>>> s = np.array(['foo', 'bar'])
>>> s
array(['foo', 'bar'], dtype='<U3')
>>> np.strings.endswith(s, 'ar')
array([False,  True])
>>> np.strings.endswith(s, 'a', start=1, end=2)
array([False,  True])

)r   _endswith_ufunc)rT   suffixr   r   s       r5   r   r     s    J #cC1e11r7   c                     [        [        U [        R                  S[	        X5      5      [        R
                  " S5      5      $ )a}  
Calls :meth:`bytes.decode` element-wise.

The set of available codecs comes from the Python standard library,
and may be extended at runtime.  For more information, see the
:mod:`codecs` module.

Parameters
----------
a : array_like, with ``bytes_`` dtype

encoding : str, optional
   The name of an encoding

errors : str, optional
   Specifies how to handle encoding errors

Returns
-------
out : ndarray

See Also
--------
:py:meth:`bytes.decode`

Notes
-----
The type of the result will depend on the encoding specified.

Examples
--------
>>> import numpy as np
>>> c = np.array([b'\x81\xc1\x81\xc1\x81\xc1', b'@@\x81\xc1@@',
...               b'\x81\x82\xc2\xc1\xc2\x82\x81'])
>>> c
array([b'\x81\xc1\x81\xc1\x81\xc1', b'@@\x81\xc1@@',
       b'\x81\x82\xc2\xc1\xc2\x82\x81'], dtype='|S7')
>>> np.strings.decode(c, encoding='cp037')
array(['aAaAaA', '  aA  ', 'abBABba'], dtype='<U7')

rI    )ra   r   rQ   r   rg   rR   rT   encodingerrorss      r5   rI   rI     s4    V "Arzz8[-JK
 r7   c                     [        [        U [        R                  S[	        X5      5      [        R
                  " S5      5      $ )u  
Calls :meth:`str.encode` element-wise.

The set of available codecs comes from the Python standard library,
and may be extended at runtime. For more information, see the
:mod:`codecs` module.

Parameters
----------
a : array_like, with ``StringDType`` or ``str_`` dtype

encoding : str, optional
   The name of an encoding

errors : str, optional
   Specifies how to handle encoding errors

Returns
-------
out : ndarray

See Also
--------
str.encode

Notes
-----
The type of the result will depend on the encoding specified.

Examples
--------
>>> import numpy as np
>>> a = np.array(['aAaAaA', '  aA  ', 'abBABba'])
>>> np.strings.encode(a, encoding='cp037')
array([b'ÁÁÁ', b'@@Á@@',
   b'ÂÁÂ'], dtype='|S7')

rJ   r7   )ra   r   rQ   r   rg   bytes_r   s      r5   rJ   rJ   -  s4    P "Arzz8[-JK
		# r7   c                 \   [         R                  " U 5      n [         R                  " U5      nU R                  R                  S:X  a  [	        X5      $ [        X5      nU R                  R                   UR                  5        3n[         R                  " XR                  US9n[	        XUS9$ )a  
Return a copy of each string element where all tab characters are
replaced by one or more spaces.

Calls :meth:`str.expandtabs` element-wise.

Return a copy of each string element where all tab characters are
replaced by one or more spaces, depending on the current column
and the given `tabsize`. The column number is reset to zero after
each newline occurring in the string. This doesn't understand other
non-printing characters or escape sequences.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array
tabsize : int, optional
    Replace tabs with `tabsize` number of spaces.  If not given defaults
    to 8 spaces.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input type

See Also
--------
str.expandtabs

Examples
--------
>>> import numpy as np
>>> a = np.array(['         Hello   world'])
>>> np.strings.expandtabs(a, tabsize=4)  # doctest: +SKIP
array(['        Hello   world'], dtype='<U21')  # doctest: +SKIP

rj   rl   rn   )	rQ   rp   rO   ru   r&   r%   rz   r{   rm   )rT   tabsizer   r   ro   s        r5   r<   r<   Z  s    P 	aAmmG$Gww||s1&&$Q0K77<<.!2 34I
--!2!2)
DCqs++r7   c                 R   [         R                  " U5      n[         R                  " UR                  [         R                  5      (       d  [        SUR                   S35      e[         R                  " U 5      n [         R                  " U5      n[         R                  " [        U5      S:g  5      (       a  [        S5      e[         R                  " X5      R                  S:X  a  [        XU5      $ UR                  U R                  SS9n[         R                  " [        U 5      U5      nU R                  R                   UR                  5        3n[         R                  " U R                  UR                  UR                  5      n[         R                   " XUS9n[        XX%S	9$ )
a  
Return a copy of `a` with its elements centered in a string of
length `width`.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

width : array_like, with any integer dtype
    The length of the resulting strings, unless ``width < str_len(a)``.
fillchar : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Optional padding character to use (default is space).

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.center

Notes
-----
While it is possible for ``a`` and ``fillchar`` to have different dtypes,
passing a non-ASCII character in ``fillchar`` when ``a`` is of dtype "S"
is not allowed, and a ``ValueError`` is raised.

Examples
--------
>>> import numpy as np
>>> c = np.array(['a1b2','1b2a','b2a1','2a1b']); c
array(['a1b2', '1b2a', 'b2a1', '2a1b'], dtype='<U4')
>>> np.strings.center(c, width=9)
array(['   a1b2  ', '   1b2a  ', '   b2a1  ', '   2a1b  '], dtype='<U9')
>>> np.strings.center(c, width=9, fillchar='*')
array(['***a1b2**', '***1b2a**', '***b2a1**', '***2a1b**'], dtype='<U9')
>>> np.strings.center(c, width=1)
array(['a1b2', '1b2a', 'b2a1', '2a1b'], dtype='<U4')

ri    for operand 'width'rk   5The fill character must be exactly one character longrj   Fcopyrl   rn   )rQ   rp   rq   rO   rr   rs   rv   r   result_typeru   r'   rY   rt   rz   broadcast_shapesrm   r{   )rT   widthfillcharr   rm   ro   s         r5   r=   r=     s6   X MM% E==bjj11+EKK=8LMNN
aA}}X&H	vvgh1$%%CE 	E 
~~a"''3.q**qwwU3HJJwqz5)E77<<..IhnnEE
--i
8C1X//r7   c                 R   [         R                  " U5      n[         R                  " UR                  [         R                  5      (       d  [        SUR                   S35      e[         R                  " U 5      n [         R                  " U5      n[         R                  " [        U5      S:g  5      (       a  [        S5      e[         R                  " X5      R                  S:X  a  [        XU5      $ UR                  U R                  SS9n[         R                  " [        U 5      U5      n[         R                  " U R                  UR                  UR                  5      nU R                  R                   UR                  5        3n[         R                   " XUS9n[        XX%S	9$ )
a+  
Return an array with the elements of `a` left-justified in a
string of length `width`.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

width : array_like, with any integer dtype
    The length of the resulting strings, unless ``width < str_len(a)``.
fillchar : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Optional character to use for padding (default is space).

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.ljust

Notes
-----
While it is possible for ``a`` and ``fillchar`` to have different dtypes,
passing a non-ASCII character in ``fillchar`` when ``a`` is of dtype "S"
is not allowed, and a ``ValueError`` is raised.

Examples
--------
>>> import numpy as np
>>> c = np.array(['aAaAaA', '  aA  ', 'abBABba'])
>>> np.strings.ljust(c, width=3)
array(['aAaAaA', '  aA  ', 'abBABba'], dtype='<U7')
>>> np.strings.ljust(c, width=9)
array(['aAaAaA   ', '  aA     ', 'abBABba  '], dtype='<U9')

ri   r   rk   r   rj   Fr   rl   rn   )rQ   rp   rq   rO   rr   rs   rv   r   r   ru   r(   rY   rt   r   rm   rz   r{   rT   r   r   rm   r   ro   s         r5   r>   r>     6   R MM% E==bjj11+EKK=8LMNN
aA}}X&H	vvgh1$%%CE 	E 
~~a"''3.a))qwwU3HJJwqz5)EhnnEE77<<..I
--i
8C!H..r7   c                 R   [         R                  " U5      n[         R                  " UR                  [         R                  5      (       d  [        SUR                   S35      e[         R                  " U 5      n [         R                  " U5      n[         R                  " [        U5      S:g  5      (       a  [        S5      e[         R                  " X5      R                  S:X  a  [        XU5      $ UR                  U R                  SS9n[         R                  " [        U 5      U5      n[         R                  " U R                  UR                  UR                  5      nU R                  R                   UR                  5        3n[         R                   " XUS9n[        XX%S	9$ )
a(  
Return an array with the elements of `a` right-justified in a
string of length `width`.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

width : array_like, with any integer dtype
    The length of the resulting strings, unless ``width < str_len(a)``.
fillchar : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Optional padding character to use (default is space).

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.rjust

Notes
-----
While it is possible for ``a`` and ``fillchar`` to have different dtypes,
passing a non-ASCII character in ``fillchar`` when ``a`` is of dtype "S"
is not allowed, and a ``ValueError`` is raised.

Examples
--------
>>> import numpy as np
>>> a = np.array(['aAaAaA', '  aA  ', 'abBABba'])
>>> np.strings.rjust(a, width=3)
array(['aAaAaA', '  aA  ', 'abBABba'], dtype='<U7')
>>> np.strings.rjust(a, width=9)
array(['   aAaAaA', '     aA  ', '  abBABba'], dtype='<U9')

ri   r   rk   r   rj   Fr   rl   rn   )rQ   rp   rq   rO   rr   rs   rv   r   r   ru   r)   rY   rt   r   rm   rz   r{   r   s         r5   r?   r?     r   r7   c                 b   [         R                  " U5      n[         R                  " UR                  [         R                  5      (       d  [        SUR                   S35      e[         R                  " U 5      n U R                  R                  S:X  a  [        X5      $ [         R                  " [        U 5      U5      n[         R                  " U R                  UR                  5      nU R                  R                   UR                  5        3n[         R                  " XUS9n[        XUS9$ )a|  
Return the numeric string left-filled with zeros. A leading
sign prefix (``+``/``-``) is handled by inserting the padding
after the sign character rather than before.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

width : array_like, with any integer dtype
    Width of string to left-fill elements in `a`.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input type

See Also
--------
str.zfill

Examples
--------
>>> import numpy as np
>>> np.strings.zfill(['1', '-1', '+1'], 3)
array(['001', '-01', '+01'], dtype='<U3')

ri   r   rj   rl   rn   )rQ   rp   rq   rO   rr   rs   ru   r*   rt   r   r   rm   rz   r{   )rT   r   rm   r   ro   s        r5   r@   r@   R  s    > MM% E==bjj11+EKK=8LMNN
aAww||saJJwqz5)E5E77<<..I
--i
8C!$$r7   c                 4    Uc  [        U 5      $ [        X5      $ )a  
For each element in `a`, return a copy with the leading characters
removed.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
chars : scalar with the same dtype as ``a``, optional
   The ``chars`` argument is a string specifying the set of
   characters to be removed. If ``None``, the ``chars``
   argument defaults to removing whitespace. The ``chars`` argument
   is not a prefix or suffix; rather, all combinations of its
   values are stripped.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.lstrip

Examples
--------
>>> import numpy as np
>>> c = np.array(['aAaAaA', '  aA  ', 'abBABba'])
>>> c
array(['aAaAaA', '  aA  ', 'abBABba'], dtype='<U7')
# The 'a' variable is unstripped from c[1] because of leading whitespace.
>>> np.strings.lstrip(c, 'a')
array(['AaAaA', '  aA  ', 'bBABba'], dtype='<U7')
>>> np.strings.lstrip(c, 'A') # leaves c unchanged
array(['aAaAaA', '  aA  ', 'abBABba'], dtype='<U7')
>>> (np.strings.lstrip(c, ' ') == np.strings.lstrip(c, '')).all()
np.False_
>>> (np.strings.lstrip(c, ' ') == np.strings.lstrip(c)).all()
np.True_

)r   r   rT   charss     r5   r8   r8     s     V }!!$$""r7   c                 4    Uc  [        U 5      $ [        X5      $ )a  
For each element in `a`, return a copy with the trailing characters
removed.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
chars : scalar with the same dtype as ``a``, optional
   The ``chars`` argument is a string specifying the set of
   characters to be removed. If ``None``, the ``chars``
   argument defaults to removing whitespace. The ``chars`` argument
   is not a prefix or suffix; rather, all combinations of its
   values are stripped.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.rstrip

Examples
--------
>>> import numpy as np
>>> c = np.array(['aAaAaA', 'abBABba'])
>>> c
array(['aAaAaA', 'abBABba'], dtype='<U7')
>>> np.strings.rstrip(c, 'a')
array(['aAaAaA', 'abBABb'], dtype='<U7')
>>> np.strings.rstrip(c, 'A')
array(['aAaAa', 'abBABba'], dtype='<U7')

)r    r!   r   s     r5   r9   r9     s     L }!!$$""r7   c                 4    Uc  [        U 5      $ [        X5      $ )a  
For each element in `a`, return a copy with the leading and
trailing characters removed.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
chars : scalar with the same dtype as ``a``, optional
   The ``chars`` argument is a string specifying the set of
   characters to be removed. If ``None``, the ``chars``
   argument defaults to removing whitespace. The ``chars`` argument
   is not a prefix or suffix; rather, all combinations of its
   values are stripped.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.strip

Examples
--------
>>> import numpy as np
>>> c = np.array(['aAaAaA', '  aA  ', 'abBABba'])
>>> c
array(['aAaAaA', '  aA  ', 'abBABba'], dtype='<U7')
>>> np.strings.strip(c)
array(['aAaAaA', 'aA', 'abBABba'], dtype='<U7')
# 'a' unstripped from c[1] because of leading whitespace.
>>> np.strings.strip(c, 'a')
array(['AaAaA', '  aA  ', 'bBABb'], dtype='<U7')
# 'A' unstripped from c[1] because of trailing whitespace.
>>> np.strings.strip(c, 'A')
array(['aAaAa', '  aA  ', 'abBABba'], dtype='<U7')

)r"   r#   r   s     r5   r:   r:     s     T } ##!!r7   c                 Z    [         R                  " U 5      n[        XR                  S5      $ )am  
Return an array with the elements converted to uppercase.

Calls :meth:`str.upper` element-wise.

For 8-bit strings, this method is locale-dependent.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.upper

Examples
--------
>>> import numpy as np
>>> c = np.array(['a1b c', '1bca', 'bca1']); c
array(['a1b c', '1bca', 'bca1'], dtype='<U5')
>>> np.strings.upper(c)
array(['A1B C', '1BCA', 'BCA1'], dtype='<U5')

rC   rQ   rW   r   rO   rT   a_arrs     r5   rC   rC     #    B JJqMEukk733r7   c                 Z    [         R                  " U 5      n[        XR                  S5      $ )al  
Return an array with the elements converted to lowercase.

Call :meth:`str.lower` element-wise.

For 8-bit strings, this method is locale-dependent.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.lower

Examples
--------
>>> import numpy as np
>>> c = np.array(['A1B C', '1BCA', 'BCA1']); c
array(['A1B C', '1BCA', 'BCA1'], dtype='<U5')
>>> np.strings.lower(c)
array(['a1b c', '1bca', 'bca1'], dtype='<U5')

rD   r   r   s     r5   rD   rD   0  r   r7   c                 Z    [         R                  " U 5      n[        XR                  S5      $ )a  
Return element-wise a copy of the string with
uppercase characters converted to lowercase and vice versa.

Calls :meth:`str.swapcase` element-wise.

For 8-bit strings, this method is locale-dependent.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.swapcase

Examples
--------
>>> import numpy as np
>>> c=np.array(['a1B c','1b Ca','b Ca1','cA1b'],'S5'); c
array(['a1B c', '1b Ca', 'b Ca1', 'cA1b'],
    dtype='|S5')
>>> np.strings.swapcase(c)
array(['A1b C', '1B cA', 'B cA1', 'Ca1B'],
    dtype='|S5')

rE   r   r   s     r5   rE   rE   U  s#    H JJqMEukk:66r7   c                 Z    [         R                  " U 5      n[        XR                  S5      $ )a  
Return a copy of ``a`` with only the first character of each element
capitalized.

Calls :meth:`str.capitalize` element-wise.

For byte strings, this method is locale-dependent.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array of strings to capitalize.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.capitalize

Examples
--------
>>> import numpy as np
>>> c = np.array(['a1b2','1b2a','b2a1','2a1b'],'S4'); c
array(['a1b2', '1b2a', 'b2a1', '2a1b'],
    dtype='|S4')
>>> np.strings.capitalize(c)
array(['A1b2', '1b2a', 'B2a1', '2a1b'],
    dtype='|S4')

rF   r   r   s     r5   rF   rF   }  s#    H JJqMEukk<88r7   c                 Z    [         R                  " U 5      n[        XR                  S5      $ )a  
Return element-wise title cased version of string or unicode.

Title case words start with uppercase characters, all remaining cased
characters are lowercase.

Calls :meth:`str.title` element-wise.

For 8-bit strings, this method is locale-dependent.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.title

Examples
--------
>>> import numpy as np
>>> c=np.array(['a1b c','1b ca','b ca1','ca1b'],'S5'); c
array(['a1b c', '1b ca', 'b ca1', 'ca1b'],
    dtype='|S5')
>>> np.strings.title(c)
array(['A1B C', '1B Ca', 'B Ca1', 'Ca1B'],
    dtype='|S5')

rG   r   r   s     r5   rG   rG     s#    L JJqMEukk733r7   c                 "   [         R                  " U5      n[         R                  " UR                  [         R                  5      (       d  [        SUR                   S35      e[         R                  " U 5      n[        USS5      n[         R                  " U5      n[        USS5      n[         R                  " U5      n[         R                  " XAU5      R                  S:X  a  [        XAX#5      $ UR                  nUR                  U(       a  UOUSS9nUR                  U(       a  UOUSS9n[         R                  " [         R                  5      R                  n[        XASU5      n	[         R                  " US:  U	[         R                   " X5      5      n	[#        U5      U	[#        U5      [#        U5      -
  -  -   n
UR                  R                   U
R                  5        3n[         R$                  " XJR&                  US	9n[        XAX)US
9$ )a  
For each element in ``a``, return a copy of the string with
occurrences of substring ``old`` replaced by ``new``.

Parameters
----------
a : array_like, with ``bytes_`` or ``str_`` dtype

old, new : array_like, with ``bytes_`` or ``str_`` dtype

count : array_like, with ``int_`` dtype
    If the optional argument ``count`` is given, only the first
    ``count`` occurrences are replaced.

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.replace

Examples
--------
>>> import numpy as np
>>> a = np.array(["That is a mango", "Monkeys eat mangos"])
>>> np.strings.replace(a, 'mango', 'banana')
array(['That is a banana', 'Monkeys eat bananas'], dtype='<U19')

>>> a = np.array(["The dish is fresh", "This is it"])
>>> np.strings.replace(a, 'is', 'was')
array(['The dwash was fresh', 'Thwas was it'], dtype='<U19')

ri   z for operand 'count'rO   Nrj   Fr   r   rl   rn   )rQ   rp   rq   rO   rr   rs   getattrr   ru   r$   rY   iinfoint64rz   r   whereminimumr   r{   rm   )rT   oldnewr   arr	old_dtype	new_dtypea_dt	max_int64countsr   r   ro   s                r5   r;   r;     s   L MM% E==bjj11+EKK=8LMNN
--
CWd+I
--
CWd+I
--
C	~~c$))S0#--99D
**)YE*
BC
**)YE*
BC"&&I#Ay1FXXeaiF)BCF#,73<'#,+F!GGK99>>";??#4"56I
--#4#4I
FCCcs33r7   c                 P    [        [        U [        R                  SU45      U5      $ )a  
Return a string which is the concatenation of the strings in the
sequence `seq`.

Calls :meth:`str.join` element-wise.

Parameters
----------
sep : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
seq : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

Returns
-------
out : ndarray
    Output array of ``StringDType``, ``bytes_`` or ``str_`` dtype,
    depending on input types

See Also
--------
str.join

Examples
--------
>>> import numpy as np
>>> np.strings.join('-', 'osd')  # doctest: +SKIP
array('o-s-d', dtype='<U5')  # doctest: +SKIP

>>> np.strings.join(['-', '.'], ['ghc', 'osd'])  # doctest: +SKIP
array(['g-h-c', 'o.s.d'], dtype='<U5')  # doctest: +SKIP

joinr   )sepseqs     r5   _joinr     s(    @ "CVcV4c; ;r7   c           	      T    [        U [        R                  SU/[        U5      -   5      $ )aK  
For each element in `a`, return a list of the words in the
string, using `sep` as the delimiter string.

Calls :meth:`str.split` element-wise.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

sep : str or unicode, optional
   If `sep` is not specified or None, any whitespace string is a
   separator.

maxsplit : int, optional
    If `maxsplit` is given, at most `maxsplit` splits are done.

Returns
-------
out : ndarray
    Array of list objects

Examples
--------
>>> import numpy as np
>>> x = np.array("Numpy is nice!")
>>> np.strings.split(x, " ")  # doctest: +SKIP
array(list(['Numpy', 'is', 'nice!']), dtype=object)  # doctest: +SKIP

>>> np.strings.split(x, " ", 1)  # doctest: +SKIP
array(list(['Numpy', 'is nice!']), dtype=object)  # doctest: +SKIP

See Also
--------
str.split, rsplit

splitr   rQ   r   rg   rT   r   maxsplits      r5   _splitr   3  s+    P 	2::wH(= =? ?r7   c           	      T    [        U [        R                  SU/[        U5      -   5      $ )af  
For each element in `a`, return a list of the words in the
string, using `sep` as the delimiter string.

Calls :meth:`str.rsplit` element-wise.

Except for splitting from the right, `rsplit`
behaves like `split`.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

sep : str or unicode, optional
    If `sep` is not specified or None, any whitespace string
    is a separator.
maxsplit : int, optional
    If `maxsplit` is given, at most `maxsplit` splits are done,
    the rightmost ones.

Returns
-------
out : ndarray
    Array of list objects

See Also
--------
str.rsplit, split

Examples
--------
>>> import numpy as np
>>> a = np.array(['aAaAaA', 'abBABba'])
>>> np.strings.rsplit(a, 'A')  # doctest: +SKIP
array([list(['a', 'a', 'a', '']),  # doctest: +SKIP
       list(['abB', 'Bba'])], dtype=object)  # doctest: +SKIP

rsplitr   r   s      r5   _rsplitr   _  s-    R 	2::x#X)>!>@ @r7   c                 L    [        U [        R                  S[        U5      5      $ )a  
For each element in `a`, return a list of the lines in the
element, breaking at line boundaries.

Calls :meth:`str.splitlines` element-wise.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype

keepends : bool, optional
    Line breaks are not included in the resulting list unless
    keepends is given and true.

Returns
-------
out : ndarray
    Array of list objects

See Also
--------
str.splitlines

Examples
--------
>>> np.char.splitlines("first line\nsecond line")
array(list(['first line', 'second line']), dtype=object)
>>> a = np.array(["first\nsecond", "third\nfourth"])
>>> np.char.splitlines(a)
array([list(['first', 'second']), list(['third', 'fourth'])], dtype=object)


splitlinesr   )rT   keependss     r5   _splitlinesr     s$    B 	2::|[%:< <r7   c           	      h   [         R                  " U 5      n [         R                  " U5      n[         R                  " X5      R                  S:X  a  [	        X5      $ UR                  U R                  SS9n[        XS[        5      n[        U 5      n[        U5      nUS:  n[         R                  " XSU5      n[         R                  " USX2-
  U-
  5      nSR                  UR                  5       [         R                  " U5      (       a  SOUR                  5       UR                  5       4 Vs/ s H  oR                  R                   U 3PM     sn5      n	[         R                  " U R                  UR                  5      n
[         R                   " X
U	S9n[#        XX+S   US	   US
   4S9$ s  snf )a  
Partition each element in ``a`` around ``sep``.

For each element in ``a``, split the element at the first
occurrence of ``sep``, and return a 3-tuple containing the part
before the separator, the separator itself, and the part after
the separator. If the separator is not found, the first item of
the tuple will contain the whole string, and the second and third
ones will be the empty string.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array
sep : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Separator to split each string element in ``a``.

Returns
-------
out : 3-tuple:
    - array with ``StringDType``, ``bytes_`` or ``str_`` dtype with the
      part before the separator
    - array with ``StringDType``, ``bytes_`` or ``str_`` dtype with the
      separator
    - array with ``StringDType``, ``bytes_`` or ``str_`` dtype with the
      part after the separator

See Also
--------
str.partition

Examples
--------
>>> import numpy as np
>>> x = np.array(["Numpy is nice!"])
>>> np.strings.partition(x, " ")
(array(['Numpy'], dtype='<U5'),
 array([' '], dtype='<U1'),
 array(['is nice!'], dtype='<U8'))

rj   Fr   r   ,rk   rl   f0f1f2rn   )rQ   rp   r   ru   r+   rY   rO   r   r   r   r   r   rz   allr   rm   r{   r,   rT   r   posr~   sep_len	not_foundbuffersizes1buffersizes3nr   rm   ro   s               r5   rA   rA     sh   V 	aA
--
C	~~a""c)!!!
**QWW5*
)C
aa
%CAJEclGaI88Ic2L88Iq%+*?@LVVIGKKM9  91WW\\N1#. 9  I
 3E
--i
8CAC$iTCI-NOO   /#F/c           	      h   [         R                  " U 5      n [         R                  " U5      n[         R                  " X5      R                  S:X  a  [	        X5      $ UR                  U R                  SS9n[        XS[        5      n[        U 5      n[        U5      nUS:  n[         R                  " USU5      n[         R                  " XSX2-
  U-
  5      nSR                  UR                  5       [         R                  " U5      (       a  SOUR                  5       UR                  5       4 Vs/ s H  oR                  R                   U 3PM     sn5      n	[         R                  " U R                  UR                  5      n
[         R                   " X
U	S9n[#        XX+S   US	   US
   4S9$ s  snf )a  
Partition (split) each element around the right-most separator.

For each element in ``a``, split the element at the last
occurrence of ``sep``, and return a 3-tuple containing the part
before the separator, the separator itself, and the part after
the separator. If the separator is not found, the third item of
the tuple will contain the whole string, and the first and second
ones will be the empty string.

Parameters
----------
a : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Input array
sep : array-like, with ``StringDType``, ``bytes_``, or ``str_`` dtype
    Separator to split each string element in ``a``.

Returns
-------
out : 3-tuple:
    - array with ``StringDType``, ``bytes_`` or ``str_`` dtype with the
      part before the separator
    - array with ``StringDType``, ``bytes_`` or ``str_`` dtype with the
      separator
    - array with ``StringDType``, ``bytes_`` or ``str_`` dtype with the
      part after the separator

See Also
--------
str.rpartition

Examples
--------
>>> import numpy as np
>>> a = np.array(['aAaAaA', '  aA  ', 'abBABba'])
>>> np.strings.rpartition(a, 'A')
(array(['aAaAa', '  a', 'abB'], dtype='<U5'),
 array(['A', 'A', 'A'], dtype='<U1'),
 array(['', '  ', 'Bba'], dtype='<U3'))

rj   Fr   r   r   rk   rl   r   r   r   rn   )rQ   rp   r   ru   r-   rY   rO   r   r   r   r   r   rz   r   r   rm   r{   r.   r   s               r5   rB   rB     sm   V 	aA
--
C	~~a""c)1""
**QWW5*
)C
qq#
&CAJEclGaI88Iq#.L88IekG.CDLVVIGKKM9  91WW\\N1#. 9  I
 3E
--i
8C	d)SYD	:< <r   c           	         [         R                  " U 5      n[        UR                  R                  [         R
                  5      (       a  [        X3R                  SU45      $ [        UUR                  SU/[        U5      -   5      $ )a  
For each element in `a`, return a copy of the string where all
characters occurring in the optional argument `deletechars` are
removed, and the remaining characters have been mapped through the
given translation table.

Calls :meth:`str.translate` element-wise.

Parameters
----------
a : array-like, with `np.bytes_` or `np.str_` dtype

table : str of length 256

deletechars : str

Returns
-------
out : ndarray
    Output array of str or unicode, depending on input type

See Also
--------
str.translate

Examples
--------
>>> import numpy as np
>>> a = np.array(['a1b c', '1bca', 'bca1'])
>>> table = a[0].maketrans('abc', '123')
>>> deletechars = ' '
>>> np.char.translate(a, table, deletechars)
array(['112 3', '1231', '2311'], dtype='<U5')

rK   )rQ   rW   rN   rO   rP   rR   r   rg   )rT   tabledeletecharsr   s       r5   rK   rK   :  sr    J JJqME%++""BGG,,;;eX7 	7 KKGk+..	
 	
r7   )r   N)NN)   ) )N))\__doc__rw   numpyrQ   r   r   r   r   r   r   r	   r
   r|   numpy._core.multiarrayr   numpy._core.overridesr   numpy._core.umathr   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.   r6   __all__r   r   rz   r   rU   ra   rg   rH   rI   rJ   r<   r=   r>   r?   r@   r8   r9   r:   rC   rD   rE   rF   rG   r;   r   r   r   r   rA   rB   rK    r7   r5   <module>r      s  
     / ,# # # # # # # # #L,  ( 	hhrxxJ"" O<* <*~ O!= !=H O"+ "+J O', ',T O, ,B O- -B O), ),X O%4 %4P O%2 %2P O, ,^ O) )X O0, 0,f O@0 @0F O</ </~ O</ </~ O+% +%\ O,# ,#^ O'# '#T O+" +"\ O!4 !4H O!4 !4H O$7 $7N O$9 $9N O&4 &4R O<4 <4~!;H)?X*@Z"<J O@P @PF OA< A<H O.
 .
r7   