numpy.core.defchararray.asarray(obj,itemsize=None,unicode=None,order=None)[source]¶Convert the input to achararray, copying the data only ifnecessary.
Versus a regular NumPy array of typestr orunicode, thisclass adds the following functionality:
- values automatically have whitespace removed from the endwhen indexed
- comparison operators automatically remove whitespace from theend when comparing values
- 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
unicode : bool, optional
order : {‘C’, ‘F’}, optional
|
|---|