This module provides a set of vectorized string operations for arraysof typenumpy.string_ ornumpy.unicode_. All of them are based onthe string methods in the Python standard library.
add(x1, x2) | Return element-wise string concatenation for two arrays of str or unicode. |
multiply(a, i) | Return (a * i), that is string multiple concatenation, element-wise. |
mod(a, values) | Return (a % i), that is pre-Python 2.6 string formatting (iterpolation), element-wise for a pair of array_likes of str or unicode. |
capitalize(a) | Return a copy ofa with only the first character of each element capitalized. |
center(a, width[, fillchar]) | Return a copy ofa with its elements centered in a string of lengthwidth. |
decode(a[, encoding, errors]) | Callsstr.decode element-wise. |
encode(a[, encoding, errors]) | Callsstr.encode element-wise. |
join(sep, seq) | Return a string which is the concatenation of the strings in the sequenceseq. |
ljust(a, width[, fillchar]) | Return an array with the elements ofa left-justified in a string of lengthwidth. |
lower(a) | Return an array with the elements converted to lowercase. |
lstrip(a[, chars]) | For each element ina, return a copy with the leading characters removed. |
partition(a, sep) | Partition each element ina aroundsep. |
replace(a, old, new[, count]) | For each element ina, return a copy of the string with all occurrences of substringold replaced bynew. |
rjust(a, width[, fillchar]) | Return an array with the elements ofa right-justified in a string of lengthwidth. |
rpartition(a, sep) | Partition (split) each element around the right-most separator. |
rsplit(a[, sep, maxsplit]) | For each element ina, return a list of the words in the string, usingsep as the delimiter string. |
rstrip(a[, chars]) | For each element ina, return a copy with the trailing characters removed. |
split(a[, sep, maxsplit]) | For each element ina, return a list of the words in the string, usingsep as the delimiter string. |
splitlines(a[, keepends]) | For each element ina, return a list of the lines in the element, breaking at line boundaries. |
strip(a[, chars]) | For each element ina, return a copy with the leading and trailing characters removed. |
swapcase(a) | Return element-wise a copy of the string with uppercase characters converted to lowercase and vice versa. |
title(a) | Return element-wise title cased version of string or unicode. |
translate(a, table[, deletechars]) | For each element ina, return a copy of the string where all characters occurring in the optional argumentdeletechars are removed, and the remaining characters have been mapped through the given translation table. |
upper(a) | Return an array with the elements converted to uppercase. |
zfill(a, width) | Return the numeric string left-filled with zeros |
Unlike the standard numpy comparison operators, the ones in thecharmodule strip trailing whitespace characters before performing thecomparison.
equal(x1, x2) | Return (x1 == x2) element-wise. |
not_equal(x1, x2) | Return (x1 != x2) element-wise. |
greater_equal(x1, x2) | Return (x1 >= x2) element-wise. |
less_equal(x1, x2) | Return (x1 <= x2) element-wise. |
greater(x1, x2) | Return (x1 > x2) element-wise. |
less(x1, x2) | Return (x1 < x2) element-wise. |
count(a, sub[, start, end]) | Returns an array with the number of non-overlapping occurrences of substringsub in the range [start,end]. |
find(a, sub[, start, end]) | For each element, return the lowest index in the string where substringsub is found. |
index(a, sub[, start, end]) | Likefind, but raisesValueError when the substring is not found. |
isalpha(a) | Returns true for each element if all characters in the string are alphabetic and there is at least one character, false otherwise. |
isdecimal(a) | For each element, return True if there are only decimal characters in the element. |
isdigit(a) | Returns true for each element if all characters in the string are digits and there is at least one character, false otherwise. |
islower(a) | Returns true for each element if all cased characters in the string are lowercase and there is at least one cased character, false otherwise. |
isnumeric(a) | For each element, return True if there are only numeric characters in the element. |
isspace(a) | Returns true for each element if there are only whitespace characters in the string and there is at least one character, false otherwise. |
istitle(a) | Returns true for each element if the element is a titlecased string and there is at least one character, false otherwise. |
isupper(a) | Returns true for each element if all cased characters in the string are uppercase and there is at least one character, false otherwise. |
rfind(a, sub[, start, end]) | For each element ina, return the highest index in the string where substringsub is found, such thatsub is contained within [start,end]. |
rindex(a, sub[, start, end]) | Likerfind, but raisesValueError when the substringsub is not found. |
startswith(a, prefix[, start, end]) | Returns a boolean array which isTrue where the string element ina starts withprefix, otherwiseFalse. |