code: def _to_pandas(ob):
      """Convert an array-like to a pandas object.
  
      Parameters
      ----------
      ob : array-like
          The object to convert.
  
      Returns
      -------
      pandas_structure : pd.Series or pd.DataFrame
          The correct structure based on the dimensionality of the data.
      """
      if isinstance(ob, (pd.Series, pd.DataFrame)):
          return ob
  
      if ob.ndim == 1:
          return pd.Series(ob)
      elif ob.ndim == 2:
          return pd.DataFrame(ob)
      else:
          raise ValueError(
              "cannot convert array of dim > 2 to a pandas structure",
          )
  
imports: from __future__ import division
  import math
  import pandas
  import numpy
  from math import pow
  from scipy import stats, optimize
  from six import iteritems
  from sys import float_info
  from .utils import nanmean, nanstd, nanmin, up, down, roll, rolling_window
  from .periods import ANNUALIZATION_FACTORS, APPROX_BDAYS_PER_YEAR
  from .periods import DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY
label_desc: Use image node_id 20 for calling a global function with example usage: _to_pandas(ob) and returns: ob, pd, pd