def _is_hierarchical(x):
 item = x[0]
 if isinstance(item, (list, tuple, np.ndarray, pd.Series, pd.DataFrame)):
  return True
 else:
  return False

def _is_hierarchical ( x ) : item = x [ 0 ] if isinstance ( item , ( list , tuple , np . ndarray , pd . Series , pd . DataFrame ) ) : return True else : return False
checks if the first item of an array-like object is also array-like if so .