code: def _infer_pandas_column(col: pd.Series) -> DataType:
      if not isinstance(col, pd.Series):
          raise TypeError(f"Expected pandas.Series, got '{type(col)}'.")
      if len(col.values.shape) > 1:
          raise MlflowException(
              f"Expected 1d array, got array with shape {col.shape}"
          )
  
      if col.dtype.kind == "O":
          col = col.infer_objects()
      if col.dtype.kind == "O":
          try:
              # We convert pandas Series into list and infer the schema.
              # The real schema for internal field should be the Array's dtype
              arr_type = _infer_colspec_type(col.to_list())
              return arr_type.dtype
          except Exception as e:
              # For backwards compatibility, we fall back to string
              # if the provided array is of string type
              # This is for diviner test where df field is ('key2', 'key1', 'key0')
              if pd.api.types.is_string_dtype(col):
                  return DataType.string
              raise MlflowException(
                  f"Failed to infer schema for pandas.Series {col}. Error: {e}"
              )
      else:
          # NB: The following works for numpy types as well as pandas extension types.
          return _infer_numpy_dtype(col.dtype)
  
imports: import logging
  import warnings
  from collections import defaultdict
  from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  from mlflow.exceptions import MlflowException
  from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
  from mlflow.types import DataType
  from mlflow.types.schema import Array, ColSpec, Object, ParamSchema, ParamSpec, Property, Schema, TensorSpec
label_desc: Use image node_id 11 for calling a global function with example usage: _infer_pandas_column(col) and returns: _infer_numpy_dtype, arr_type, DataType