
    -i                        S r SSK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  SSKJr  SSKJr  SSKJr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*J+r+J,r,J-r-J.r.J/r/  SSKJ0r1  SS	KJ2r3  SS
KJ4r5  SSKJ6r7  SSKJ8r9  SSKJ:r;  SSKJ<r=  S r>\>" 5         / SQr?\R                  " \R                  5      R                  rC\R                  " \SS9rS rES rFS rGS rH\" S5      \" \H5      S 5       5       rS rI\" S5      \" \I5      S 5       5       rJ\" S5      SDS j5       r4\" S5      SDS j5       r8\" S5      SDS j5       r6\" S5      SDS j5       r:\" S5      SDS j5       r0\" S5      SDS j5       r<\" S5      SDS  j5       r2SES! jrK\" S5      \" \K5      SES" j5       5       rL\" S5      \" \K5      SES# j5       5       rMSFS$ jrN\" S5      \" \N5      SGS% j5       5       rOSFS& jrP\" S5      \" \P5      SHS' j5       5       rQ\" S5      \" \P5      SHS( j5       5       rR\" S5      \" \P5      SHS) j5       5       rSS* rT\" S5      \" \T5      S+ 5       5       rU\" S5      SFS, j5       rV\" S5      SFS- j5       rW\" S5      SFS. j5       rXS/ rY\" S5      \" \Y5      S0 5       5       rZ\" S5      \" \Y5      S1 5       5       r[\" S5      \" \Y5      S2 5       5       r\\" S5      \" \Y5      S3 5       5       r]\" S5      \" \Y5      S4 5       5       r^SFS5 jr_\" S5      \" \_5      SIS6 j5       5       r`S7 ra\" \a5      S8 5       rbSES9 jrc\" \c5      SES: j5       rd\" \c5      SES; j5       reSFS< jrf\" \f5      SFS= j5       rgS> rh\" S5      \" \h5      S? 5       5       ri\" S5      \" \h5      S@ 5       5       rjSFSA jrk\" S5      \" \k5      SFSB j5       5       rl\" S5      S\R                  S4SC j5       rng)JzK
This module contains a set of functions for vectorized string
operations.
    N)addequalgreatergreater_equalless
less_equal	not_equal)multiply)_vec_string)array_function_dispatch
set_module)_center_expandtabs_expandtabs_length_ljust_lstrip_chars_lstrip_whitespace
_partition_partition_index_replace_rjust_rpartition_rpartition_index_rstrip_chars_rstrip_whitespace_slice_strip_chars_strip_whitespace_zfillisalnumisalpha	isdecimalisdigitislower	isnumericisspaceistitleisupperstr_len)count)endswith)find)index)rfind)rindex)
startswithc            
          [         [        [        [        [        [
        [        [        [        [        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    F/var/www/html/venv/lib/python3.13/site-packages/numpy/_core/strings.py_override___module__r8   M   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*   r0   r+   lstriprstripstripreplace
expandtabscenterljustrjustzfill	partition
rpartitionsliceupperlowerswapcase
capitalizetitlemoddecodeencode	translater2   )modulec                     [        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    r7   _get_num_charsrZ   s   s5     !'',,((zzQ::r9   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   )rU   asarraysizeastyperS   tolist
isinstancedtypesStringDTyperT   rZ   )resultoutput_dtype_likerets      r7   _to_bytes_or_str_arrayrf   ~   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Ir9   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      r7   _clean_argsrl      s5     G;N 	s  Nr9   c                     U 4$ N )rY   is     r7   _multiply_dispatcherrq      	    4Kr9   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'Overflow encountered in string multiplyshaperS   out)rU   
asanyarray
issubdtyperS   integer	TypeErrormaximumcharr)   anysysmaxsizeOverflowErrormax
empty_likerx   _multiply_ufunc)rY   rp   a_lenbuffersizes	out_dtyperz   s         r7   r
   r
      s   T 	aA
aA=="**--+AGG94DEFF


1aA 	ww||suAJE 
vveckkBJJq!$44455EFF)K77<<.!2 34I
--!2!2)
DC1S))r9   c                     X4$ rn   ro   rY   valuess     r7   _mod_dispatcherr      s
    ;r9   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__rf   r   rU   object_r   s     r7   rK   rK      s(    D "Arzz9vi8!= =r9   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rY   substartends       r7   r,   r,     s    D #cCqu**r9   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       r7   r.   r.   5  s    N #cC++r9   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       r7   r-   r-   `  s    < #cC++r9   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       r7   r/   r/     s    < #cC,,r9   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       r7   r*   r*     s    R #cC++r9   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)rY   prefixr   r   s       r7   r0   r0     s    J #cCQ33r9   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)rY   suffixr   r   s       r7   r+   r+     s    J #cC1e11r9   c                     U 4$ rn   ro   rY   encodingerrorss      r7   _code_dispatcherr   #  rr   r9   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')

rL    )rf   r   rU   r   rl   rV   r   s      r7   rL   rL   '  s4    X "Arzz8[-JK
 r9   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')

rM   r9   )rf   r   rU   r   rl   bytes_r   s      r7   rM   rM   X  s4    R "Arzz8[-JK
		# r9   c                     U 4$ rn   ro   )rY   tabsizes     r7   _expandtabs_dispatcherr     rr   r9   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

ru   rw   ry   )	rU   r{   rS   r   r   r   r   r   rx   )rY   r   r   r   rz   s        r7   r>   r>     s    R 	aAmmG$Gww||s1&&$Q0K77<<.!2 34I
--!2!2)
DCqs++r9   c                     U 4$ rn   ro   )rY   widthfillchars      r7   _just_dispatcherr     rr   r9   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')

rt    for operand 'width'rv   5The fill character must be exactly one character longru   Fcopyrw   ry   )rU   r{   r|   rS   r}   r~   r   r)   result_typer   r   r^   r   r   broadcast_shapesrx   r   )rY   r   r   r   rx   rz   s         r7   r?   r?     s6   Z 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//r9   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')

rt   r   rv   r   ru   Fr   rw   ry   )rU   r{   r|   rS   r}   r~   r   r)   r   r   r   r^   r   r   rx   r   r   rY   r   r   rx   r   rz   s         r7   r@   r@     6   T 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..r9   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')

rt   r   rv   r   ru   Fr   rw   ry   )rU   r{   r|   rS   r}   r~   r   r)   r   r   r   r^   r   r   rx   r   r   r   s         r7   rA   rA   I  r   r9   c                     U 4$ rn   ro   )rY   r   s     r7   _zfill_dispatcherr     rr   r9   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')

rt   r   ru   rw   ry   )rU   r{   r|   rS   r}   r~   r   r   r   r)   r   rx   r   r   )rY   r   rx   r   rz   s        r7   rB   rB     s    @ MM% E==bjj11+EKK=8LMNN
aAww||saJJwqz5)E5E77<<..I
--i
8C!$$r9   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   rY   charss     r7   r:   r:     s     V }!!$$""r9   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     r7   r;   r;     s     L }!!$$""r9   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     r7   r<   r<     s     T } ##!!r9   c                     U 4$ rn   ro   rX   s    r7   _unary_op_dispatcherr   H  rr   r9   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')

rF   rU   r\   r   rS   rY   a_arrs     r7   rF   rF   L  #    D JJqMEukk733r9   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')

rG   r   r   s     r7   rG   rG   r  r   r9   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')

rH   r   r   s     r7   rH   rH     s#    J JJqMEukk:66r9   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')

rI   r   r   s     r7   rI   rI     s#    J JJqMEukk<88r9   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')

rJ   r   r   s     r7   rJ   rJ     s#    N JJqMEukk733r9   c                     U 4$ rn   ro   )rY   oldnewr*   s       r7   _replace_dispatcherr     rr   r9   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=(       d    USS9nUR                  U=(       d    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')

rt   z for operand 'count'rS   Nru   Fr   r   rw   ry   )rU   r{   r|   rS   r}   r~   getattrr   r   r   r^   iinfoint64r   r   whereminimumr)   r   rx   )rY   r   r   r*   arr	old_dtype	new_dtypea_dt	max_int64countsr   r   rz   s                r7   r=   r=     s   N MM% E==bjj11+EKK=8LMNN
--
CWd+I
--
CWd+I
--
C	~~c$))S0#--99D
**Y&$U*
3C
**Y&$U*
3C"&&I#Ay1FXXeaiF)BCF#,73<'#,+F!GGK99>>";??#4"56I
--#4#4I
FCCcs33r9   c                     X4$ rn   ro   sepseqs     r7   _join_dispatcherr   Z  s
    :r9   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   r   s     r7   _joinr   ^  s(    B "CVcV4c; ;r9   c                     U 4$ rn   ro   rY   r   maxsplits      r7   _split_dispatcherr     rr   r9   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   rU   r   rl   r   s      r7   _splitr     s+    R 	2::wH(= =? ?r9   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      r7   _rsplitr     s-    T 	2::x#X)>!>@ @r9   c                     U 4$ rn   ro   rY   keependss     r7   _splitlines_dispatcherr     rr   r9   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   r   s     r7   _splitlinesr     s$    D 	2::|[%:< <r9   c                     U 4$ rn   ro   )rY   r   s     r7   _partition_dispatcherr    rr   r9   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'))

ru   Fr   r   ,rv   rw   f0f1f2ry   )rU   r{   r   r   r   r^   rS   r   r   r)   r   r   r   allr   rx   r   r   rY   r   posr   sep_len	not_foundbuffersizes1buffersizes3nr   rx   rz   s               r7   rC   rC     sh   X 	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'))

ru   Fr   r   r  rv   rw   r  r  r  ry   )rU   r{   r   r   r   r^   rS   r   r   r)   r   r   r   r  r   rx   r   r   r	  s               r7   rD   rD   U  sm   X 	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                     U 4$ rn   ro   )rY   tabledeletecharss      r7   _translate_dispatcherr    rr   r9   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')

rN   )rU   r\   rR   rS   rT   rV   r   rl   )rY   r  r  r   s       r7   rN   rN     sr    L JJqME%++""BGG,,;;eX7 	7 KKGk+..	
 	
r9   c                   U[         R                  L a  UnSnUc  Sn[         R                  " U5      n[         R                  " UR                  [         R
                  5      (       d  [        SUR                   S35      e[         R                  " US:H  5      (       a  [        S5      eUcG  [         R                  " US:  [         R                  " [         R                  5      R                  S5      nUcs  [         R                  " US:  [         R                  " [         R                  5      R                  [         R                  " [         R                  5      R                  5      n[        XX#5      $ )uQ  
Slice the strings in `a` by slices specified by `start`, `stop`, `step`.
Like in the regular Python `slice` object, if only `start` is
specified then it is interpreted as the `stop`.

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

start : None, an integer or an array of integers
    The start of the slice, broadcasted to `a`'s shape

stop : None, an integer or an array of integers
    The end of the slice, broadcasted to `a`'s shape

step : None, an integer or an array of integers
    The step for the slice, broadcasted to `a`'s shape

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

Examples
--------
>>> import numpy as np
>>> a = np.array(['hello', 'world'])
>>> np.strings.slice(a, 2)
array(['he', 'wo'], dtype='<U5')

>>> np.strings.slice(a, 2, None)
array(['llo', 'rld'], dtype='<U5')

>>> np.strings.slice(a, 1, 5, 2)
array(['el', 'ol'], dtype='<U5')

One can specify different start/stop/step for different array entries:

>>> np.strings.slice(a, np.array([1, 2]), np.array([4, 5]))
array(['ell', 'rld'], dtype='<U5')

Negative slices have the same meaning as in regular Python:

>>> b = np.array(['hello world', 'γεια σου κόσμε', '你好世界', '👋 🌍'],
...              dtype=np.dtypes.StringDType())
>>> np.strings.slice(b, -2)
array(['hello wor', 'γεια σου κόσ', '你好', '👋'], dtype=StringDType())

>>> np.strings.slice(b, -2, None)
array(['ld', 'με', '世界', ' 🌍'], dtype=StringDType())

>>> np.strings.slice(b, [3, -10, 2, -3], [-1, -2, -1, 3])
array(['lo worl', ' σου κόσ', '世', '👋 🌍'], dtype=StringDType())

>>> np.strings.slice(b, None, None, -1)
array(['dlrow olleh', 'εμσόκ υοσ αιεγ', '界世好你', '🌍 👋'],
      dtype=StringDType())

Nrv   rt   z for operand 'step'r   zslice step cannot be zero)rU   _NoValuer{   r|   rS   r}   r~   r   
ValueErrorr   r   intpr   minr   )rY   r   stopsteps       r7   rE   rE     s   B r{{ |==D==RZZ00+DJJ<7JKLL	vvdai455}288BGG#4#8#8!<|xxq"((277"3"7"7"''9J9N9NO!D''r9   )r   N)NNrn   )   ) ))o__doc__	functoolsr   numpyrU   r   r   r   r   r   r   r	   r
   r   numpy._core.multiarrayr   numpy._core.overridesr   r   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   r0   r   r8   __all__r   r   r   r   partialrZ   rf   rl   rq   r   rK   r   rL   rM   r   r>   r   r?   r@   rA   r   rB   r:   r;   r<   r   rF   rG   rH   rI   rJ   r   r=   r   r   r   r   r   r   r   r  rC   rD   r  rN   r  rE   ro   r9   r7   <module>r)     s  
  
    / E       <
,  ( 	hhrxx#++O5 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, 1 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 /0"< 1"<J O./@P 0 @PF O./A< 0 A<H O./.
 0 .
` Obkk S( S(r9   