ó 2ÄÈ[c4@`sdZddlmZmZmZddlZddlmZmZm Z m Z m Z m Z ddl mZmZddl mZddlmZdd lmZmZddlZd d d d ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=g4Zdaejdd>kr~eZeZn eZeZe Z!d?„Z"d@„Z#dA„Z$dB„Z%dC„Z&dD„Z'dE„Z(dF„Z)dG„Z*dH„Z+dI„Z,dJ„Z-dK„Z.dL„Z/dM„Z0dNdO„Z1de2dP„Z3e2e2dQ„Z4e2e2dR„Z5de2dS„Z6dTdU„Z7de2dV„Z8de2dW„Z9dX„Z:dY„Z;dZ„Z<d[„Z=d\„Z>d]„Z?d^„Z@d_„ZAdNd`„ZBda„ZCe2db„ZDdc„ZEe2dd„ZFde2de„ZGde2df„ZHdNdg„ZIdh„ZJe2e2di„ZKe2dj„ZLe2e2dk„ZMe2dl„ZNde2dm„ZOe2dn„ZPdo„ZQdp„ZRe2dq„ZSdr„ZTds„ZUdt„ZVdu„ZWd efdv„ƒYZXe2eYe2e2dw„Ze2e2e2dx„ZZdS(yss This module contains a set of functions for vectorized string operations and methods. .. note:: The `chararray` class exists for backwards compatibility with Numarray, it is not recommended for new development. Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of `dtype` `object_`, `string_` or `unicode_`, and use the free functions in the `numpy.char` module for fast vectorized string operations. Some methods will only be available if the corresponding string method is available in your version of Python. The preferred alias for `defchararray` is `numpy.char`. i(tdivisiontabsolute_importtprint_functionNi(tstring_tunicode_tintegertobject_tbool_t character(tndarraytcompare_chararrays(tarray(t _vec_string(tasbytestlongt chararraytequalt not_equalt greater_equalt less_equaltgreatertlesststr_lentaddtmultiplytmodt capitalizetcentertcounttdecodetencodetendswitht expandtabstfindtindextisalnumtisalphatisdigittislowertisspacetistitletisuppertjointljusttlowertlstript partitiontreplacetrfindtrindextrjustt rpartitiontrsplittrstriptsplitt splitlinest startswithtstriptswapcasettitlet translatetuppertzfillt isnumerict isdecimalR tasarrayicG`sFx?|D]7}t|tƒs:ttj|ƒjjtƒrtSqWtS(s½ Helper function for determining the output type of some string operations. For an operation on two ndarrays, if at least one is unicode, the result should be unicode. ( t isinstancet_unicodet issubclasstnumpyRAtdtypettypeRR(targstx((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt _use_unicode2s  cC`stj|jƒƒS(s† Helper function to cast a result back into a string or unicode array if an object array must be used as an intermediary. (RERAttolist(tresult((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt_to_string_or_unicode_array@scG`s8g}x+|D]#}|dkr#Pn|j|ƒq W|S(s# 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. N(tNonetappend(RHtnewargstchk((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt _clean_argsGs   cC`s't|jjtƒr |jdS|jS(sÀ 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. i(RDRFRGRtitemsize(ta((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt_get_num_charsWs cC`st||dtƒS(s4 Return (x1 == x2) element-wise. Unlike `numpy.equal`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of str or unicode Input arrays of the same shape. Returns ------- out : ndarray or bool Output array of bools, or a single bool if x1 and x2 are scalars. See Also -------- not_equal, greater_equal, less_equal, greater, less s==(R tTrue(tx1tx2((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRbscC`st||dtƒS(s4 Return (x1 != x2) element-wise. Unlike `numpy.not_equal`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of str or unicode Input arrays of the same shape. Returns ------- out : ndarray or bool Output array of bools, or a single bool if x1 and x2 are scalars. See Also -------- equal, greater_equal, less_equal, greater, less s!=(R RV(RWRX((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRzscC`st||dtƒS(s7 Return (x1 >= x2) element-wise. Unlike `numpy.greater_equal`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of str or unicode Input arrays of the same shape. Returns ------- out : ndarray or bool Output array of bools, or a single bool if x1 and x2 are scalars. See Also -------- equal, not_equal, less_equal, greater, less s>=(R RV(RWRX((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR’scC`st||dtƒS(s4 Return (x1 <= x2) element-wise. Unlike `numpy.less_equal`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of str or unicode Input arrays of the same shape. Returns ------- out : ndarray or bool Output array of bools, or a single bool if x1 and x2 are scalars. See Also -------- equal, not_equal, greater_equal, greater, less s<=(R RV(RWRX((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR«scC`st||dtƒS(s3 Return (x1 > x2) element-wise. Unlike `numpy.greater`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of str or unicode Input arrays of the same shape. Returns ------- out : ndarray or bool Output array of bools, or a single bool if x1 and x2 are scalars. See Also -------- equal, not_equal, greater_equal, less_equal, less t>(R RV(RWRX((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRÃscC`st||dtƒS(s6 Return (x1 < x2) element-wise. Unlike `numpy.greater`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of str or unicode Input arrays of the same shape. Returns ------- out : ndarray or bool Output array of bools, or a single bool if x1 and x2 are scalars. See Also -------- equal, not_equal, greater_equal, less_equal, greater t<(R RV(RWRX((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRÛscC`st|tdƒS(sä Return len(a) element-wise. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of integers See also -------- __builtin__.len t__len__(R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRóscC`s_tj|ƒ}tj|ƒ}t|ƒt|ƒ}t||ƒ}t|||fd|fƒS(s¿ Return element-wise string concatenation for two arrays of str or unicode. Arrays `x1` and `x2` must have the same shape. Parameters ---------- x1 : array_like of str or unicode Input array. x2 : array_like of str or unicode Input array. Returns ------- add : ndarray Output array of `string_` or `unicode_`, depending on input types of the same shape as `x1` and `x2`. t__add__(RERARURJR (RWRXtarr1tarr2tout_sizeRF((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRs cC`s‰tj|ƒ}tj|ƒ}t|jjtƒsBtdƒ‚nt|ƒtt |jƒƒdƒ}t ||jj|fd|fƒS(sv 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 of str or unicode i : array_like of ints Returns ------- out : ndarray Output array of str or unicode, depending on input types sCan only multiply by integersit__mul__( RERARDRFRGRt ValueErrorRUtmaxRR (RTtita_arrti_arrR_((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR s%cC`stt|td|fƒƒS(sÚ Return (a % i), that is pre-Python 2.6 string formatting (iterpolation), element-wise for a pair of array_likes of str or unicode. Parameters ---------- a : array_like of str or unicode values : array_like of values These values will be element-wise interpolated into the string. Returns ------- out : ndarray Output array of str or unicode, depending on input types See also -------- str.__mod__ t__mod__(RMR R(RTtvalues((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR<scC`s"tj|ƒ}t||jdƒS(sÌ Return a copy of `a` with only the first character of each element capitalized. Calls `str.capitalize` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Input array of strings to capitalize. Returns ------- out : ndarray Output array of str or unicode, depending on input types See also -------- str.capitalize Examples -------- >>> c = np.array(['a1b2','1b2a','b2a1','2a1b'],'S4'); c array(['a1b2', '1b2a', 'b2a1', '2a1b'], dtype='|S4') >>> np.char.capitalize(c) array(['A1b2', '1b2a', 'B2a1', '2a1b'], dtype='|S4') R(RERAR RF(RTRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRVs"t cC`s‚tj|ƒ}tj|ƒ}ttj|jƒƒ}tj|jtjƒr]t|ƒ}nt ||jj |fd||fƒS(s Return a copy of `a` with its elements centered in a string of length `width`. Calls `str.center` element-wise. Parameters ---------- a : array_like of str or unicode width : int The length of the resulting strings fillchar : str or unicode, optional The padding character to use (default is space). Returns ------- out : ndarray Output array of str or unicode, depending on input types See also -------- str.center R( RERARRbtflatt issubdtypeRFRR R RG(RTtwidthtfillcharRdt width_arrtsize((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR|scC`s#t|td||gt|ƒƒS(s¾ Returns an array with the number of non-overlapping occurrences of substring `sub` in the range [`start`, `end`]. Calls `str.count` element-wise. Parameters ---------- a : array_like of str or unicode sub : str or unicode The substring to search for. start, end : int, optional Optional arguments `start` and `end` are interpreted as slice notation to specify the range in which to count. Returns ------- out : ndarray Output array of ints. See also -------- str.count Examples -------- >>> c = np.array(['aAaAaA', ' aA ', 'abBABba']) >>> c array(['aAaAaA', ' aA ', 'abBABba'], dtype='|S7') >>> np.char.count(c, 'A') array([3, 1, 1]) >>> np.char.count(c, 'aA') array([3, 1, 0]) >>> np.char.count(c, 'A', start=1, end=4) array([2, 1, 1]) >>> np.char.count(c, 'A', start=1, end=3) array([1, 0, 0]) R(R RRR(RTtsubtstarttend((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR s+cC`s"tt|tdt||ƒƒƒS(s… Calls `str.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 of str or unicode encoding : str, optional The name of an encoding errors : str, optional Specifies how to handle encoding errors Returns ------- out : ndarray See also -------- str.decode Notes ----- The type of the result will depend on the encoding specified. Examples -------- >>> c = np.array(['aAaAaA', ' aA ', 'abBABba']) >>> c array(['aAaAaA', ' aA ', 'abBABba'], dtype='|S7') >>> np.char.encode(c, encoding='cp037') array(['\x81\xc1\x81\xc1\x81\xc1', '@@\x81\xc1@@', '\x81\x82\xc2\xc1\xc2\x82\x81'], dtype='|S7') R(RMR RRR(RTtencodingterrors((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRÎs*cC`s"tt|tdt||ƒƒƒS(sA Calls `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 codecs module. Parameters ---------- a : array_like of str or unicode 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. R(RMR RRR(RTRrRs((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRüscC`s#t|td||gt|ƒƒS(s= Returns a boolean array which is `True` where the string element in `a` ends with `suffix`, otherwise `False`. Calls `str.endswith` element-wise. Parameters ---------- a : array_like of str or unicode suffix : str start, end : int, optional With optional `start`, test beginning at that position. With optional `end`, stop comparing at that position. Returns ------- out : ndarray Outputs an array of bools. See also -------- str.endswith Examples -------- >>> s = np.array(['foo', 'bar']) >>> s[0] = 'foo' >>> s[1] = 'bar' >>> s array(['foo', 'bar'], dtype='|S3') >>> np.char.endswith(s, 'ar') array([False, True]) >>> np.char.endswith(s, 'a', start=1, end=2) array([False, True]) R(R RRR(RTtsuffixRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRs(icC`stt|td|fƒƒS(sS Return a copy of each string element where all tab characters are replaced by one or more spaces. Calls `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 of str or unicode 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 str or unicode, depending on input type See also -------- str.expandtabs R (RMR R(RTttabsize((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR KscC`s#t|td||gt|ƒƒS(sŸ For each element, return the lowest index in the string where substring `sub` is found. Calls `str.find` element-wise. 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 of str or unicode sub : str or unicode start, end : int, optional Optional arguments `start` and `end` are interpreted as in slice notation. Returns ------- out : ndarray or int Output array of ints. Returns -1 if `sub` is not found. See also -------- str.find R!(R RRR(RTRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR!nscC`s#t|td||gt|ƒƒS(s Like `find`, but raises `ValueError` when the substring is not found. Calls `str.index` element-wise. Parameters ---------- a : array_like of str or unicode sub : str or unicode start, end : int, optional Returns ------- out : ndarray Output array of ints. Returns -1 if `sub` is not found. See also -------- find, str.find R"(R RRR(RTRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR"‘scC`st|tdƒS(sÌ Returns true for each element if all characters in the string are alphanumeric and there is at least one character, false otherwise. Calls `str.isalnum` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of str or unicode, depending on input type See also -------- str.isalnum R#(R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR#¬scC`st|tdƒS(s¨ Returns true for each element if all characters in the string are alphabetic and there is at least one character, false otherwise. Calls `str.isalpha` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of bools See also -------- str.isalpha R$(R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR$ÄscC`st|tdƒS(s¤ Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise. Calls `str.isdigit` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of bools See also -------- str.isdigit R%(R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR%ÜscC`st|tdƒS(s· Returns true for each element if all cased characters in the string are lowercase and there is at least one cased character, false otherwise. Calls `str.islower` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of bools See also -------- str.islower R&(R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR&ôscC`st|tdƒS(s³ Returns true for each element if there are only whitespace characters in the string and there is at least one character, false otherwise. Calls `str.isspace` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of bools See also -------- str.isspace R'(R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR' scC`st|tdƒS(sž Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise. Call `str.istitle` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of bools See also -------- str.istitle R((R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR(&scC`st|tdƒS(s° Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise. Call `str.isupper` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like of str or unicode Returns ------- out : ndarray Output array of bools See also -------- str.isupper R)(R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR)>scC`stt|td|fƒƒS(sƒ Return a string which is the concatenation of the strings in the sequence `seq`. Calls `str.join` element-wise. Parameters ---------- sep : array_like of str or unicode seq : array_like of str or unicode Returns ------- out : ndarray Output array of str or unicode, depending on input types See also -------- str.join R*(RMR R(tseptseq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR*WscC`s‚tj|ƒ}tj|ƒ}ttj|jƒƒ}tj|jtjƒr]t|ƒ}nt ||jj |fd||fƒS(sð Return an array with the elements of `a` left-justified in a string of length `width`. Calls `str.ljust` element-wise. Parameters ---------- a : array_like of str or unicode width : int The length of the resulting strings fillchar : str or unicode, optional The character to use for padding Returns ------- out : ndarray Output array of str or unicode, depending on input type See also -------- str.ljust R+( RERARRbRiRjRFRR R RG(RTRkRlRdRmRn((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR+pscC`s"tj|ƒ}t||jdƒS(s{ Return an array with the elements converted to lowercase. Call `str.lower` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like, {str, unicode} Input array. Returns ------- out : ndarray, {str, unicode} Output array of str or unicode, depending on input type See also -------- str.lower Examples -------- >>> c = np.array(['A1B C', '1BCA', 'BCA1']); c array(['A1B C', '1BCA', 'BCA1'], dtype='|S5') >>> np.char.lower(c) array(['a1b c', '1bca', 'bca1'], dtype='|S5') R,(RERAR RF(RTRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR,“s cC`s(tj|ƒ}t||jd|fƒS(s‡ For each element in `a`, return a copy with the leading characters removed. Calls `str.lstrip` element-wise. Parameters ---------- a : array-like, {str, unicode} Input array. chars : {str, unicode}, optional The `chars` argument is a string specifying the set of characters to be removed. If omitted or None, the `chars` argument defaults to removing whitespace. The `chars` argument is not a prefix; rather, all combinations of its values are stripped. Returns ------- out : ndarray, {str, unicode} Output array of str or unicode, depending on input type See also -------- str.lstrip Examples -------- >>> c = np.array(['aAaAaA', ' aA ', 'abBABba']) >>> c array(['aAaAaA', ' aA ', 'abBABba'], dtype='|S7') The 'a' variable is unstripped from c[1] because whitespace leading. >>> np.char.lstrip(c, 'a') array(['AaAaA', ' aA ', 'bBABba'], dtype='|S7') >>> np.char.lstrip(c, 'A') # leaves c unchanged array(['aAaAaA', ' aA ', 'abBABba'], dtype='|S7') >>> (np.char.lstrip(c, ' ') == np.char.lstrip(c, '')).all() ... # XXX: is this a regression? this line now returns False ... # np.char.lstrip(c,'') does not modify c at all. True >>> (np.char.lstrip(c, ' ') == np.char.lstrip(c, None)).all() True R-(RERAR RF(RTtcharsRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR-·s5cC`stt|td|fƒƒS(sU Partition each element in `a` around `sep`. Calls `str.partition` element-wise. For each element in `a`, split the element as the first occurrence of `sep`, and return 3 strings containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return 3 strings containing the string itself, followed by two empty strings. Parameters ---------- a : array_like, {str, unicode} Input array sep : {str, unicode} Separator to split each string element in `a`. Returns ------- out : ndarray, {str, unicode} Output array of str or unicode, depending on input type. The output array will have an extra dimension with 3 elements per input element. See also -------- str.partition R.(RMR R(RTRv((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR.ðscC`s)tt|td||gt|ƒƒƒS(s% For each element in `a`, return a copy of the string with all occurrences of substring `old` replaced by `new`. Calls `str.replace` element-wise. Parameters ---------- a : array-like of str or unicode old, new : str or unicode count : int, optional If the optional argument `count` is given, only the first `count` occurrences are replaced. Returns ------- out : ndarray Output array of str or unicode, depending on input type See also -------- str.replace R/(RMR RRR(RTtoldtnewR((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR/scC`s#t|td||gt|ƒƒS(s. For each element in `a`, return the highest index in the string where substring `sub` is found, such that `sub` is contained within [`start`, `end`]. Calls `str.rfind` element-wise. Parameters ---------- a : array-like of str or unicode sub : str or unicode start, end : int, optional Optional arguments `start` and `end` are interpreted as in slice notation. Returns ------- out : ndarray Output array of ints. Return -1 on failure. See also -------- str.rfind R0(R RRR(RTRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR03scC`s#t|td||gt|ƒƒS(sx Like `rfind`, but raises `ValueError` when the substring `sub` is not found. Calls `str.rindex` element-wise. Parameters ---------- a : array-like of str or unicode sub : str or unicode start, end : int, optional Returns ------- out : ndarray Output array of ints. See also -------- rfind, str.rindex R1(R RRR(RTRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR1SscC`s‚tj|ƒ}tj|ƒ}ttj|jƒƒ}tj|jtjƒr]t|ƒ}nt ||jj |fd||fƒS(sñ Return an array with the elements of `a` right-justified in a string of length `width`. Calls `str.rjust` element-wise. Parameters ---------- a : array_like of str or unicode width : int The length of the resulting strings fillchar : str or unicode, optional The character to use for padding Returns ------- out : ndarray Output array of str or unicode, depending on input type See also -------- str.rjust R2( RERARRbRiRjRFRR R RG(RTRkRlRdRmRn((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR2pscC`stt|td|fƒƒS(sf Partition (split) each element around the right-most separator. Calls `str.rpartition` element-wise. For each element in `a`, split the element as the last occurrence of `sep`, and return 3 strings containing the part before the separator, the separator itself, and the part after the separator. If the separator is not found, return 3 strings containing the string itself, followed by two empty strings. Parameters ---------- a : array_like of str or unicode Input array sep : str or unicode Right-most separator to split each element in array. Returns ------- out : ndarray Output array of string or unicode, depending on input type. The output array will have an extra dimension with 3 elements per input element. See also -------- str.rpartition R3(RMR R(RTRv((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR3“scC`s t|td|gt|ƒƒS(s¢ For each element in `a`, return a list of the words in the string, using `sep` as the delimiter string. Calls `str.rsplit` element-wise. Except for splitting from the right, `rsplit` behaves like `split`. Parameters ---------- a : array_like of str or unicode 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 R4(R RRR(RTRvtmaxsplit((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR4¶s!cC`s(tj|ƒ}t||jd|fƒS(sÍ For each element in `a`, return a copy with the trailing characters removed. Calls `str.rstrip` element-wise. Parameters ---------- a : array-like of str or unicode chars : str or unicode, optional The `chars` argument is a string specifying the set of characters to be removed. If omitted or None, the `chars` argument defaults to removing whitespace. The `chars` argument is not a suffix; rather, all combinations of its values are stripped. Returns ------- out : ndarray Output array of str or unicode, depending on input type See also -------- str.rstrip Examples -------- >>> c = np.array(['aAaAaA', 'abBABba'], dtype='S7'); c array(['aAaAaA', 'abBABba'], dtype='|S7') >>> np.char.rstrip(c, 'a') array(['aAaAaA', 'abBABb'], dtype='|S7') >>> np.char.rstrip(c, 'A') array(['aAaAa', 'abBABba'], dtype='|S7') R5(RERAR RF(RTRxRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR5Ûs(cC`s t|td|gt|ƒƒS(s8 For each element in `a`, return a list of the words in the string, using `sep` as the delimiter string. Calls `str.split` element-wise. Parameters ---------- a : array_like of str or unicode 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 See also -------- str.split, rsplit R6(R RRR(RTRvR{((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR6scC`st|tdt|ƒƒS(sÙ For each element in `a`, return a list of the lines in the element, breaking at line boundaries. Calls `str.splitlines` element-wise. Parameters ---------- a : array_like of str or unicode 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 R7(R RRR(RTtkeepends((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR7)scC`s#t|td||gt|ƒƒS(s Returns a boolean array which is `True` where the string element in `a` starts with `prefix`, otherwise `False`. Calls `str.startswith` element-wise. Parameters ---------- a : array_like of str or unicode prefix : str start, end : int, optional With optional `start`, test beginning at that position. With optional `end`, stop comparing at that position. Returns ------- out : ndarray Array of booleans See also -------- str.startswith R8(R RRR(RTtprefixRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR8FscC`s+tj|ƒ}t||jdt|ƒƒS(s For each element in `a`, return a copy with the leading and trailing characters removed. Calls `str.strip` element-wise. Parameters ---------- a : array-like of str or unicode chars : str or unicode, optional The `chars` argument is a string specifying the set of characters to be removed. If omitted or 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 str or unicode, depending on input type See also -------- str.strip Examples -------- >>> c = np.array(['aAaAaA', ' aA ', 'abBABba']) >>> c array(['aAaAaA', ' aA ', 'abBABba'], dtype='|S7') >>> np.char.strip(c) array(['aAaAaA', 'aA', 'abBABba'], dtype='|S7') >>> np.char.strip(c, 'a') # 'a' unstripped from c[1] because whitespace leads array(['AaAaA', ' aA ', 'bBABb'], dtype='|S7') >>> np.char.strip(c, 'A') # 'A' unstripped from c[1] because (unprinted) ws trails array(['aAaAa', ' aA ', 'abBABba'], dtype='|S7') R9(RERAR RFRR(RTRxRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR9es,cC`s"tj|ƒ}t||jdƒS(sÓ Return element-wise a copy of the string with uppercase characters converted to lowercase and vice versa. Calls `str.swapcase` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like, {str, unicode} Input array. Returns ------- out : ndarray, {str, unicode} Output array of str or unicode, depending on input type See also -------- str.swapcase Examples -------- >>> c=np.array(['a1B c','1b Ca','b Ca1','cA1b'],'S5'); c array(['a1B c', '1b Ca', 'b Ca1', 'cA1b'], dtype='|S5') >>> np.char.swapcase(c) array(['A1b C', '1B cA', 'B cA1', 'Ca1B'], dtype='|S5') R:(RERAR RF(RTRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR:•s!cC`s"tj|ƒ}t||jdƒS(só Return element-wise title cased version of string or unicode. Title case words start with uppercase characters, all remaining cased characters are lowercase. Calls `str.title` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like, {str, unicode} Input array. Returns ------- out : ndarray Output array of str or unicode, depending on input type See also -------- str.title Examples -------- >>> c=np.array(['a1b c','1b ca','b ca1','ca1b'],'S5'); c array(['a1b c', '1b ca', 'b ca1', 'ca1b'], dtype='|S5') >>> np.char.title(c) array(['A1B C', '1B Ca', 'B Ca1', 'Ca1B'], dtype='|S5') R;(RERAR RF(RTRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR;ºs#cC`sdtj|ƒ}t|jjtƒr=t||jd|fƒSt||jd|gt|ƒƒSdS(s, 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 `str.translate` element-wise. Parameters ---------- a : array-like of str or unicode table : str of length 256 deletechars : str Returns ------- out : ndarray Output array of str or unicode, depending on input type See also -------- str.translate R<N(RERARDRFRGRR RR(RTttablet deletecharsRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR<ás cC`s"tj|ƒ}t||jdƒS(sx Return an array with the elements converted to uppercase. Calls `str.upper` element-wise. For 8-bit strings, this method is locale-dependent. Parameters ---------- a : array_like, {str, unicode} Input array. Returns ------- out : ndarray, {str, unicode} Output array of str or unicode, depending on input type See also -------- str.upper Examples -------- >>> c = np.array(['a1b c', '1bca', 'bca1']); c array(['a1b c', '1bca', 'bca1'], dtype='|S5') >>> np.char.upper(c) array(['A1B C', '1BCA', 'BCA1'], dtype='|S5') R=(RERAR RF(RTRd((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR=s cC`sXtj|ƒ}tj|ƒ}ttj|jƒƒ}t||jj|fd|fƒS(s¡ Return the numeric string left-filled with zeros Calls `str.zfill` element-wise. Parameters ---------- a : array_like, {str, unicode} Input array. width : int Width of string to left-fill elements in `a`. Returns ------- out : ndarray, {str, unicode} Output array of str or unicode, depending on input type See also -------- str.zfill R>(RERARRbRiR RFRG(RTRkRdRmRn((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR>)s cC`s1t|ƒtkr!tdƒ‚nt|tdƒS(s For each element, return True if there are only numeric characters in the element. Calls `unicode.isnumeric` element-wise. Numeric characters include digit characters, and all characters that have the Unicode numeric value property, e.g. ``U+2155, VULGAR FRACTION ONE FIFTH``. Parameters ---------- a : array_like, unicode Input array. Returns ------- out : ndarray, bool Array of booleans of same shape as `a`. See also -------- unicode.isnumeric s:isnumeric is only available for Unicode strings and arraysR?(RJRt TypeErrorR R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR?GscC`s1t|ƒtkr!tdƒ‚nt|tdƒS(s! For each element, return True if there are only decimal characters in the element. Calls `unicode.isdecimal` element-wise. Decimal characters include digit characters, and all characters that that can be used to form decimal-radix numbers, e.g. ``U+0660, ARABIC-INDIC DIGIT ZERO``. Parameters ---------- a : array_like, unicode Input array. Returns ------- out : ndarray, bool Array of booleans identical in shape to `a`. See also -------- unicode.isdecimal s:isnumeric is only available for Unicode strings and arraysR@(RJRR€R R(RT((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR@fscB`s‡eZdZded?dd?dd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z d „Z d „Zd„Zd„Zd„Zd„Zd„Zddd?d„Zejje_d„Zdd„Zdd?d„Zd?d?d„Zd?d?d„Zdd?d„Zdd„Zdd?d„Zdd?d „Zd!„Zd"„Z d#„Z!d$„Z"d%„Z#d&„Z$d'„Z%d(„Z&dd)„Z'd*„Z(d?d+„Z)d,„Z*d?d-„Z+dd?d.„Z,dd?d/„Z-dd0„Z.d1„Z/d?d?d2„Z0d?d3„Z1d?d?d4„Z2d?d5„Z3dd?d6„Z4d?d7„Z5d8„Z6d9„Z7d?d:„Z8d;„Z9d<„Z:d=„Z;d>„Z<RS(@sê chararray(shape, itemsize=1, unicode=False, buffer=None, offset=0, strides=None, order=None) Provides a convenient view on arrays of string and unicode values. .. note:: The `chararray` class exists for backwards compatibility with Numarray, it is not recommended for new development. Starting from numpy 1.4, if one needs arrays of strings, it is recommended to use arrays of `dtype` `object_`, `string_` or `unicode_`, and use the free functions in the `numpy.char` module for fast vectorized string operations. Versus a regular NumPy array of type `str` or `unicode`, this class adds the following functionality: 1) values automatically have whitespace removed from the end when indexed 2) comparison operators automatically remove whitespace from the end when comparing values 3) vectorized string operations are provided as methods (e.g. `.endswith`) and infix operators (e.g. ``"+", "*", "%"``) chararrays should be created using `numpy.char.array` or `numpy.char.asarray`, rather than this constructor directly. This constructor creates the array, using `buffer` (with `offset` and `strides`) if it is not ``None``. If `buffer` is ``None``, then constructs a new array with `strides` in "C order", unless both ``len(shape) >= 2`` and ``order='Fortran'``, in which case `strides` is in "Fortran order". Methods ------- astype argsort copy count decode dump dumps encode endswith expandtabs fill find flatten getfield index isalnum isalpha isdecimal isdigit islower isnumeric isspace istitle isupper item join ljust lower lstrip nonzero put ravel repeat replace reshape resize rfind rindex rjust rsplit rstrip searchsorted setfield setflags sort split splitlines squeeze startswith strip swapaxes swapcase take title tofile tolist tostring translate transpose upper view zfill Parameters ---------- shape : tuple Shape of the array. itemsize : int, optional Length of each array element, in number of characters. Default is 1. unicode : bool, optional Are the array elements of type unicode (True) or string (False). Default is False. buffer : int, optional Memory address of the start of the array data. Default is None, in which case a new array is created. offset : int, optional Fixed stride displacement from the beginning of an axis? Default is 0. Needs to be >=0. strides : array_like of ints, optional Strides for the array (see `ndarray.strides` for full description). Default is None. order : {'C', 'F'}, optional The order in which the array data is stored in memory: 'C' -> "row major" order (the default), 'F' -> "column major" (Fortran) order. Examples -------- >>> charar = np.chararray((3, 3)) >>> charar[:] = 'a' >>> charar chararray([['a', 'a', 'a'], ['a', 'a', 'a'], ['a', 'a', 'a']], dtype='|S1') >>> charar = np.chararray(charar.shape, itemsize=5) >>> charar[:] = 'abc' >>> charar chararray([['abc', 'abc', 'abc'], ['abc', 'abc', 'abc'], ['abc', 'abc', 'abc']], dtype='|S5') iitCc C`sä|rt}nt}t|ƒ}tjddkrRt|tƒrR|} d}nd} da|dkrŽt j ||||fd|ƒ} n3t j ||||fd|d|d|d|ƒ} | dk rÚ| | d= other) element-wise. See also -------- greater_equal (R(RŽR˜((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt__ge__`scC`s t||ƒS(sl Return (self <= other) element-wise. See also -------- less_equal (R(RŽR˜((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt__le__jscC`s t||ƒS(sh Return (self > other) element-wise. See also -------- greater (R(RŽR˜((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt__gt__tscC`s t||ƒS(se Return (self < other) element-wise. See also -------- less (R(RŽR˜((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt__lt__~scC`stt||ƒƒS(s· Return (self + other), that is string concatenation, element-wise for a pair of array_likes of str or unicode. See also -------- add (RAR(RŽR˜((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR\ˆs cC`stttj|ƒ|ƒƒS(sÀ Return (other + self), that is string concatenation, element-wise for a pair of array_likes of `string_` or `unicode_`. See also -------- add (RARRE(RŽR˜((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt__radd__“s cC`stt||ƒƒS(s• Return (self * i), that is string multiple concatenation, element-wise. See also -------- multiply (RAR(RŽRc((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR`žs cC`stt||ƒƒS(s• Return (self * i), that is string multiple concatenation, element-wise. See also -------- multiply (RAR(RŽRc((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt__rmul__©s cC`stt||ƒƒS(sß Return (self % i), that is pre-Python 2.6 string formatting (iterpolation), element-wise for a pair of array_likes of `string_` or `unicode_`. See also -------- mod (RAR(RŽRc((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRf´s cC`stS(N(tNotImplemented(RŽR˜((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyt__rmod__Àsiÿÿÿÿt quicksortcC`s|jƒj|||ƒS(s Return the indices that sort the array lexicographically. For full documentation see `numpy.argsort`, for which this method is in fact merely a "thin wrapper." Examples -------- >>> c = np.array(['a1b c', '1b ca', 'b ca1', 'Ca1b'], 'S5') >>> c = c.view(np.chararray); c chararray(['a1b c', '1b ca', 'b ca1', 'Ca1b'], dtype='|S5') >>> c[c.argsort()] chararray(['1b ca', 'Ca1b', 'a1b c', 'b ca1'], dtype='|S5') (t __array__targsort(RŽtaxistkindR‚((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR¥ÃscC`stt|ƒƒS(s¨ Return a copy of `self` with only the first character of each element capitalized. See also -------- char.capitalize (RAR(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRØs RhcC`stt|||ƒƒS(s Return a copy of `self` with its elements centered in a string of length `width`. See also -------- center (RAR(RŽRkRl((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRäs cC`st||||ƒS(s Returns an array with the number of non-overlapping occurrences of substring `sub` in the range [`start`, `end`]. See also -------- char.count (R(RŽRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRïs cC`st|||ƒS(sj Calls `str.decode` element-wise. See also -------- char.decode (R(RŽRrRs((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRûs cC`st|||ƒS(sj Calls `str.encode` element-wise. See also -------- char.encode (R(RŽRrRs((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRs cC`st||||ƒS(sÅ Returns a boolean array which is `True` where the string element in `self` ends with `suffix`, otherwise `False`. See also -------- char.endswith (R(RŽRtRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRs icC`stt||ƒƒS(s· Return a copy of each string element where all tab characters are replaced by one or more spaces. See also -------- char.expandtabs (RAR (RŽRu((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR s cC`st||||ƒS(s§ For each element, return the lowest index in the string where substring `sub` is found. See also -------- char.find (R!(RŽRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR!)s cC`st||||ƒS(sŽ Like `find`, but raises `ValueError` when the substring is not found. See also -------- char.index (R"(RŽRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR"5s cC`s t|ƒS(sß Returns true for each element if all characters in the string are alphanumeric and there is at least one character, false otherwise. See also -------- char.isalnum (R#(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR#@s cC`s t|ƒS(sÝ Returns true for each element if all characters in the string are alphabetic and there is at least one character, false otherwise. See also -------- char.isalpha (R$(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR$Ms cC`s t|ƒS(sÑ Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise. See also -------- char.isdigit (R%(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR%Zs cC`s t|ƒS(sè Returns true for each element if all cased characters in the string are lowercase and there is at least one cased character, false otherwise. See also -------- char.islower (R&(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR&fs cC`s t|ƒS(sä Returns true for each element if there are only whitespace characters in the string and there is at least one character, false otherwise. See also -------- char.isspace (R'(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR'ss cC`s t|ƒS(sÌ Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise. See also -------- char.istitle (R((RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR(€s cC`s t|ƒS(sâ Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise. See also -------- char.isupper (R)(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR)Œs cC`s t||ƒS(s  Return a string which is the concatenation of the strings in the sequence `seq`. See also -------- char.join (R*(RŽRw((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR*™s cC`stt|||ƒƒS(sª Return an array with the elements of `self` left-justified in a string of length `width`. See also -------- char.ljust (RAR+(RŽRkRl((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR+¥s cC`stt|ƒƒS(s” Return an array with the elements of `self` converted to lowercase. See also -------- char.lower (RAR,(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR,±s cC`stt||ƒƒS(s  For each element in `self`, return a copy with the leading characters removed. See also -------- char.lstrip (RAR-(RŽRx((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR-½s cC`stt||ƒƒS(su Partition each element in `self` around `sep`. See also -------- partition (RAR.(RŽRv((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR.ÉscC`stt||||ƒƒS(sÅ For each element in `self`, return a copy of the string with all occurrences of substring `old` replaced by `new`. See also -------- char.replace (RAR/(RŽRyRzR((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR/Ós cC`st||||ƒS(sñ For each element in `self`, return the highest index in the string where substring `sub` is found, such that `sub` is contained within [`start`, `end`]. See also -------- char.rfind (R0(RŽRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR0ßs cC`st||||ƒS(sž Like `rfind`, but raises `ValueError` when the substring `sub` is not found. See also -------- char.rindex (R1(RŽRoRpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR1ìs cC`stt|||ƒƒS(s« Return an array with the elements of `self` right-justified in a string of length `width`. See also -------- char.rjust (RAR2(RŽRkRl((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR2øs cC`stt||ƒƒS(sv Partition each element in `self` around `sep`. See also -------- rpartition (RAR3(RŽRv((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR3 scC`st|||ƒS(s¼ For each element in `self`, return a list of the words in the string, using `sep` as the delimiter string. See also -------- char.rsplit (R4(RŽRvR{((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR4 s cC`stt||ƒƒS(s¡ For each element in `self`, return a copy with the trailing characters removed. See also -------- char.rstrip (RAR5(RŽRx((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR5 s cC`st|||ƒS(s» For each element in `self`, return a list of the words in the string, using `sep` as the delimiter string. See also -------- char.split (R6(RŽRvR{((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR6& s cC`s t||ƒS(s¹ For each element in `self`, return a list of the lines in the element, breaking at line boundaries. See also -------- char.splitlines (R7(RŽR|((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR72 s cC`st||||ƒS(sÉ Returns a boolean array which is `True` where the string element in `self` starts with `prefix`, otherwise `False`. See also -------- char.startswith (R8(RŽR}RpRq((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR8> s cC`stt||ƒƒS(s¬ For each element in `self`, return a copy with the leading and trailing characters removed. See also -------- char.strip (RAR9(RŽRx((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR9J s cC`stt|ƒƒS(sÌ For each element in `self`, return a copy of the string with uppercase characters converted to lowercase and vice versa. See also -------- char.swapcase (RAR:(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR:V s cC`stt|ƒƒS(sô For each element in `self`, return a titlecased version of the string: words start with uppercase characters, all remaining cased characters are lowercase. See also -------- char.title (RAR;(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR;b s cC`stt|||ƒƒS(sB For each element in `self`, 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. See also -------- char.translate (RAR<(RŽR~R((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR<o s cC`stt|ƒƒS(s” Return an array with the elements of `self` converted to uppercase. See also -------- char.upper (RAR=(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR=} s cC`stt||ƒƒS(s  Return the numeric string left-filled with zeros in a string of length `width`. See also -------- char.zfill (RAR>(RŽRk((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR>‰ s cC`s t|ƒS(s± For each element in `self`, return True if there are only numeric characters in the element. See also -------- char.isnumeric (R?(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR?• s cC`s t|ƒS(s± For each element in `self`, return True if there are only decimal characters in the element. See also -------- char.isdecimal (R@(RŽ((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR@¡ s N(=t__name__t __module__t__doc__tFalseRNR‰R’R”R™RšR›RœRRžR\RŸR`R RfR¢R¥R RRRRRRR R!R"R#R$R%R&R'R(R)R*R+R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@(((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR…st "                c C`sút|ttfƒrÑ|d krBt|tƒr9t}qBt}n|d kr]t|ƒ}nt|ƒ|}|r£tjdkr”|j dƒ}q¯t|ƒ}n t|ƒ}t |d|d|d|d|ƒSt|t t fƒrøt j|ƒ}nt|tƒrEt|jjtƒrEt|t ƒs=|jt ƒ}n|d krw|j}t|jjtƒrw|d}qwn|d krªt|jjtƒr¡t}qªt}n|r¹t}nt}|d k rãt j|d|ƒ}n|s#||jks#| rt|tƒs#|rAt|tƒrA|j|t|ƒfƒ}n|St|tƒr‡t|jjtƒr‡|d kr‡|jƒ}q‡n|r–t}nt}|d krÉt|d|d|d tƒ}n$t|d||fd|d tƒ}|jt ƒS( s§ Create a `chararray`. .. note:: This class is provided for numarray backward-compatibility. New code (not concerned with numarray compatibility) should use arrays of type `string_` or `unicode_` and use the free functions in :mod:`numpy.char ` for fast vectorized string operations instead. Versus a regular NumPy array of type `str` or `unicode`, this class adds the following functionality: 1) values automatically have whitespace removed from the end when indexed 2) comparison operators automatically remove whitespace from the end when comparing values 3) vectorized string operations are provided as methods (e.g. `str.endswith`) and infix operators (e.g. ``+, *, %``) Parameters ---------- obj : array of str or unicode-like itemsize : int, optional `itemsize` is the number of characters per scalar in the resulting array. If `itemsize` is None, and `obj` is an object array or a Python list, the `itemsize` will be automatically determined. If `itemsize` is provided and `obj` is of type str or unicode, then the `obj` string will be chunked into `itemsize` pieces. copy : bool, optional If true (default), then the object is copied. Otherwise, a copy will only be made if __array__ returns a copy, if obj is a nested sequence, or if a copy is needed to satisfy any of the other requirements (`itemsize`, unicode, `order`, etc.). unicode : bool, optional When true, the resulting `chararray` can contain Unicode characters, when false only 8-bit characters. If unicode is `None` and `obj` is one of the following: - a `chararray`, - an ndarray of type `str` or `unicode` - a Python str or unicode object, then the unicode setting of the output array will be automatically determined. order : {'C', 'F', 'A'}, optional Specify the order of the array. If order is 'C' (default), then the array will be in C-contiguous order (last-index varies the fastest). If order is 'F', then the returned array will be in Fortran-contiguous order (first-index varies the fastest). If order is 'A', then the returned array may be in any order (either C-, Fortran-contiguous, or even discontiguous). iÿÿtutf_32RSRŒRƒR‚iRFtsubokN(RBt_bytesRCRNRVR«R•R†t maxunicodeRRtlistttupleRERAR RDRFRGRtviewRSRRtastypeRtobjectRKtnarray(R‘RStcopyRŒR‚R‹RFR–((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyR ® sb>       $       $   !$c C`st||dtd|d|ƒS(sÝ Convert the input to a `chararray`, copying the data only if necessary. Versus a regular NumPy array of type `str` or `unicode`, this class adds the following functionality: 1) values automatically have whitespace removed from the end when indexed 2) comparison operators automatically remove whitespace from the end when comparing values 3) vectorized string operations are provided as methods (e.g. `str.endswith`) and infix operators (e.g. ``+``, ``*``,``%``) Parameters ---------- obj : array of str or unicode-like itemsize : int, optional `itemsize` is the number of characters per scalar in the resulting array. If `itemsize` is None, and `obj` is an object array or a Python list, the `itemsize` will be automatically determined. If `itemsize` is provided and `obj` is of type str or unicode, then the `obj` string will be chunked into `itemsize` pieces. unicode : bool, optional When true, the resulting `chararray` can contain Unicode characters, when false only 8-bit characters. If unicode is `None` and `obj` is one of the following: - a `chararray`, - an ndarray of type `str` or 'unicode` - a Python str or unicode object, then the unicode setting of the output array will be automatically determined. order : {'C', 'F'}, optional Specify the order of the array. If order is 'C' (default), then the array will be in C-contiguous order (last-index varies the fastest). If order is 'F', then the returned array will be in Fortran-contiguous order (first-index varies the fastest). R¶RŒR‚(R R«(R‘RSRŒR‚((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyRAF s0([Rªt __future__RRRR†t numerictypesRRRRRRtnumericR R R Rµtnumpy.core.multiarrayR t numpy.compatR RREt__all__RˆR‡tstrRCtbytesR®RŒtlenR•RJRMRRRURRRRRRRRRRRRRNRRRRR R!R"R#R$R%R&R'R(R)R*R+R,R-R.R/R0R1R2R3R4R5R6R7R8R9R:R;R<R=R>R?R@RRVRA(((s6/tmp/pip-build-fiC0ax/numpy/numpy/core/defchararray.pyts¦ .                 & $..#, ##         # $ 9 #   # #% ,"  0 % ' $ $   ÿÿÿ,˜