def meta_nonempty(x):
 if isinstance(x, pd.Index):
  return _nonempty_index(x)
 elif isinstance(x, pd.Series):
  idx = _nonempty_index(x.index)
  return _nonempty_series(x, idx)
 elif isinstance(x, pd.DataFrame):
  idx = _nonempty_index(x.index)
  data = {i: _nonempty_series(x.iloc[:, i], idx) for (i, c) in enumerate(x.columns)}
  res = pd.DataFrame(data, index=idx, columns=np.arange(len(x.columns)))
  res.columns = x.columns
  return res
 elif is_scalar(x):
  return _nonempty_scalar(x)
 else:
  raise TypeError('Expected Index, Series, DataFrame, or scalar, got {0}'.format(type(x).__name__))

def meta_nonempty ( x ) : if isinstance ( x , pd . Index ) : return _nonempty_index ( x ) elif isinstance ( x , pd . Series ) : idx = _nonempty_index ( x . index ) return _nonempty_series ( x , idx ) elif isinstance ( x , pd . DataFrame ) : idx = _nonempty_index ( x . index ) data = { i : _nonempty_series ( x . iloc [ : , i ] , idx ) for ( i , c ) in enumerate ( x . columns ) } res = pd . DataFrame ( data , index = idx , columns = np . arange ( len ( x . columns ) ) ) res . columns = x . columns return res elif is_scalar ( x ) : return _nonempty_scalar ( x ) else : raise TypeError ( 'Expected Index, Series, DataFrame, or scalar, got {0}' . format ( type ( x ) . __name__ ) )
create a nonempty pandas object from the given metadata .