def _unconvert_string_array(data, nan_rep=None, encoding=None):
 shape = data.shape
 data = np.asarray(data.ravel(), dtype=object)
 encoding = _ensure_encoding(encoding)
 if ((encoding is not None) and len(data)):
  itemsize = lib.max_len_string_array(_ensure_object(data))
  if compat.PY3:
   dtype = 'U{0}'.format(itemsize)
  else:
   dtype = 'S{0}'.format(itemsize)
  if isinstance(data[0], compat.binary_type):
   data = Series(data).str.decode(encoding).values
  else:
   data = data.astype(dtype, copy=False).astype(object, copy=False)
 if (nan_rep is None):
  nan_rep = 'nan'
 data = lib.string_array_replace_from_nan_rep(data, nan_rep)
 return data.reshape(shape)

def _unconvert_string_array ( data , nan_rep = None , encoding = None ) : shape = data . shape data = np . asarray ( data . ravel ( ) , dtype = object ) encoding = _ensure_encoding ( encoding ) if ( ( encoding is not None ) and len ( data ) ) : itemsize = lib . max_len_string_array ( _ensure_object ( data ) ) if compat . PY3 : dtype = 'U{0}' . format ( itemsize ) else : dtype = 'S{0}' . format ( itemsize ) if isinstance ( data [ 0 ] , compat . binary_type ) : data = Series ( data ) . str . decode ( encoding ) . values else : data = data . astype ( dtype , copy = False ) . astype ( object , copy = False ) if ( nan_rep is None ) : nan_rep = 'nan' data = lib . string_array_replace_from_nan_rep ( data , nan_rep ) return data . reshape ( shape )
inverse of _convert_string_array parameters data : fixed length string dtyped array nan_rep : the storage repr of nan .