code: def replace_nan(
      data: np.ndarray,
      nan_mask: np.ndarray,
      idx: int,
      column_name: str,
      replacement: Optional[float],
  ) -> None:
      array = data[..., idx]
      nan_mask = nan_mask[..., idx]
      if not np.any(nan_mask):
          return
      if replacement is None:
          msg = f"nan values occurred at column {column_name} but replacement is not available"
          raise ValueError(msg)
      array[nan_mask] = replacement
      data[..., idx] = array
  
imports: import numpy
  from enum import Enum
  from typing import Any
  from typing import Dict
  from typing import Optional
  from dataclasses import dataclass
  from .file import TArrayPair
  from .file import FileParserBlock
  from ....schema import DataBundle
  from ....schema import INoInitDataBlock
label_desc: Use image node_id 2 for calling a global function with example usage: replace_nan(data, nan_mask, idx, column_name, replacement) without return types