def _maybe_convert_string_to_object(values):
 if isinstance(values, string_types):
  values = np.array([values], dtype=object)
 elif (isinstance(values, np.ndarray) and issubclass(values.dtype.type, (np.string_, np.unicode_))):
  values = values.astype(object)
 return values

def _maybe_convert_string_to_object ( values ) : if isinstance ( values , string_types ) : values = np . array ( [ values ] , dtype = object ) elif ( isinstance ( values , np . ndarray ) and issubclass ( values . dtype . type , ( np . string_ , np . unicode_ ) ) ) : values = values . astype ( object ) return values
convert string-like and string-like array to convert object dtype .