class_docstr: _Col class. It refers to a column of a dataframe.
class_docstr_tok: ["_Col","class",".","It","refers","to","a","column","of","a","dataframe","."]
docstr: Check if the type of the column is valid.
  
  Args:
      df: The dataframe from which to check the column.
  
  Raises:
      TypeError: If the type of the column is not valid.
docstr_tok: ["Check","if","the","type","of","the","column","is","valid",".","Args",":","df",":","The","dataframe","from","which","to","check","the","column",".","Raises",":","TypeError",":","If","the","type","of","the","column","is","not","valid","."]
code: def check_col_type(self, df: pd.DataFrame) -> None:
      """Check if the type of the column is valid.
  
      Args:
          df: The dataframe from which to check the column.
  
      Raises:
          TypeError: If the type of the column is not valid.
      """
      expected_type = [
          self.mapping_python_numpy[exp_type]
          for exp_type in self.expected_type
      ]
      col_type = df[self.colname].dtype
  
      if not any(
          np.issubdtype(col_type, exp_type)
          for exp_type in expected_type
      ):
          raise TypeError(
              "column '{colname}' should be either of the following type(s): {type_name}.".format(
                  colname=self.colname,
                  type_name=str(
                      [x.__name__ for x in self.expected_type]
                  )[1:-1],
              )
          )
  
imports: import warnings
  import numpy
  import pandas
  from typing import Any, Hashable, List, Optional, Tuple, Type, Union
label_desc: Use image node_id 5 for calling the _Col obj's underlying member method code with example usage: obj.check_col_type(df) without return types