Returns True if arr is a string or a string array with a dtype that represents a unicode string, otherwise returns False.
(arr)
| 47 | |
| 48 | |
| 49 | def _is_unicode(arr): |
| 50 | """Returns True if arr is a string or a string array with a dtype that |
| 51 | represents a unicode string, otherwise returns False. |
| 52 | |
| 53 | """ |
| 54 | if (isinstance(arr, str) or |
| 55 | issubclass(numpy.asarray(arr).dtype.type, str)): |
| 56 | return True |
| 57 | return False |
| 58 | |
| 59 | |
| 60 | def _to_bytes_or_str_array(result, output_dtype_like=None): |