class_docstr: Detect columns which contain a mix of numerical and string values.
  
  Parameters
  ----------
  columns : Union[Hashable, List[Hashable]] , default: None
      Columns to check, if none are given checks all columns
      except ignored ones.
  ignore_columns : Union[Hashable, List[Hashable]] , default: None
      Columns to ignore, if none given checks based on columns
      variable.
  n_top_columns : int , optional
      amount of columns to show ordered by feature importance (date, index, label are first)
  n_samples : int , default: 10_000_000
      number of samples to use for this check.
  random_state : int, default: 42
      random seed for all check internals.
docstr: Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the "danger zone".
  
  The "danger zone" represents the following logic - if the rarer data type is, for example, 30% of the data,
  than the column is presumably supposed to contain both numbers and string values. If the rarer data type is,
  for example, less than 1% of the data, than it's presumably a contamination, but a negligible one. In the range
  between, there is a real chance that the rarer data type may represent a problem to model training and
  inference.
  
  Parameters
  ----------
  ratio_range : Tuple[float, float] , default: (0.01 , 0.1)
      The range between which the ratio of rarer data type in the column is
      considered a problem.
docstr_tok: ["Add","condition","-","Whether","the","ratio","of","rarer","data","type","(","strings","or","numbers",")","is","not","in","the","``","danger","zone","''",".","The","``","danger","zone","''","represents","the","following","logic","-","if","the","rarer","data","type","is",",","for","example",",","30","%","of","the","data",",","than","the","column","is","presumably","supposed","to","contain","both","numbers","and","string","values",".","If","the","rarer","data","type","is",",","for","example",",","less","than","1","%","of","the","data",",","than","it","'s","presumably","a","contamination",",","but","a","negligible","one",".","In","the","range","between",",","there","is","a","real","chance","that","the","rarer","data","type","may","represent","a","problem","to","model","training","and","inference",".","Parameters","--","--","--","--","--","ratio_range",":","Tuple","[","float",",","float","]",",","default",":","(","0.01",",","0.1",")","The","range","between","which","the","ratio","of","rarer","data","type","in","the","column","is","considered","a","problem","."]
code: def add_condition_rare_type_ratio_not_in_range(
      self, ratio_range: Tuple[float, float] = (0.01, 0.1)
  ):
      """Add condition - Whether the ratio of rarer data type (strings or numbers) is not in the "danger zone".
  
      The "danger zone" represents the following logic - if the rarer data type is, for example, 30% of the data,
      than the column is presumably supposed to contain both numbers and string values. If the rarer data type is,
      for example, less than 1% of the data, than it's presumably a contamination, but a negligible one. In the range
      between, there is a real chance that the rarer data type may represent a problem to model training and
      inference.
  
      Parameters
      ----------
      ratio_range : Tuple[float, float] , default: (0.01 , 0.1)
          The range between which the ratio of rarer data type in the column is
          considered a problem.
      """
  
      def condition(result):
          no_mix_columns = []
          failing_columns = []
          for col, ratios in result.items():
              # Columns without a mix contains empty dict for ratios
              if not ratios:
                  no_mix_columns.append(col)
                  continue
              rarer_ratio = min(ratios["strings"], ratios["numbers"])
              if ratio_range[0] < rarer_ratio < ratio_range[1]:
                  failing_columns.append(col)
          if failing_columns:
              details = (
                  f"Found {len(failing_columns)} out of {len(result)} columns with non-negligible quantities "
                  f"of samples with a different data type from the majority of samples: {failing_columns}"
              )
              return ConditionResult(ConditionCategory.WARN, details)
          details = (
              f"{len(result)} columns passed: found {len(result) - len(no_mix_columns)} columns with "
              f"negligible types mix, and {len(no_mix_columns)} columns without any types mix"
          )
          return ConditionResult(ConditionCategory.PASS, details)
  
      name = (
          f"Rare data types in column are either more than {format_percent(ratio_range[1])} or less "
          f"than {format_percent(ratio_range[0])} of the data"
      )
      return self.add_condition(name, condition)
  
file_path: deepchecks/deepchecks/tabular/checks/data_integrity/mixed_data_types.py
imports: from typing import List, Tuple, Union
  import numpy
  import pandas
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.tabular import Context, SingleDatasetCheck
  from deepchecks.tabular.utils.feature_importance import N_TOP_MESSAGE, column_importance_sorter_df
  from deepchecks.utils.dataframes import select_from_dataframe
  from deepchecks.utils.strings import format_list, format_number, format_percent, is_string_column, truncate_string
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 5 for calling the MixedDataTypes obj's underlying member method code with example usage: obj.add_condition_rare_type_ratio_not_in_range(ratio_range) and returns: self, ConditionResult, ConditionResult