code: def range(cls, dataset, dimension):
      dimension = dataset.get_dimension(dimension, strict=True)
      column = dataset.data[dimension.name]
      if column.dtype.kind == "O":
          if not isinstance(
              dataset.data, pd.DataFrame
          ) or util.pandas_version < Version("0.17.0"):
              column = column.sort(inplace=False)
          else:
              column = column.sort_values()
          try:
              column = column[~column.isin([None, pd.NA])]
          except Exception:
              pass
          if not len(column):
              return np.nan, np.nan
          return column.iloc[0], column.iloc[-1]
      else:
          if dimension.nodata is not None:
              column = cls.replace_value(column, dimension.nodata)
          cmin, cmax = finite_range(column, column.min(), column.max())
          if column.dtype.kind == "M" and getattr(
              column.dtype, "tz", None
          ):
              return (
                  cmin.to_pydatetime().replace(tzinfo=None),
                  cmax.to_pydatetime().replace(tzinfo=None),
              )
          return cmin, cmax
  
imports: import numpy
  import pandas
  from packaging.version import Version
  from pandas.api.types import is_numeric_dtype
  from ..None import util
  from ..dimension import Dimension, dimension_name
  from ..element import Element
  from ..ndmapping import NdMapping, item_check, sorted_context
  from .interface import DataError, Interface
  from .util import finite_range
label_desc: Use image node_id 5 for calling the PandasInterface obj's underlying member method code with example usage: obj.range(cls, dataset, dimension) and returns: column,  column, cmin,  cmax, np,  np, cmin,  cmax