code: def isordinal(x):
      import numpy as np
      if len(x) == len(np.unique(x)):
          return False, ("number of observations equals the "
                         "number of unique values.")
      if not isinstance(x[0], str):
          if not np.all(np.equal(np.mod(x, 1), 0)):
              return False, "elements are not integer or strings."
      return True, "is ordinal"