code: def _convert_df_to_numpy(
      df: pd.DataFrame, tasks: List[str]
  ) -> Tuple[np.ndarray, np.ndarray]:
      """Transforms a dataframe containing deepchem input into numpy arrays
  
      This is a private helper method intended to help parse labels and
      weights arrays from a pandas dataframe. Here `df` is a dataframe
      which has columns for each task in `tasks`. These labels are
      extracted into a labels array `y`. Weights `w` are initialized to
      all ones, but weights for any missing labels are set to 0.
  
      Parameters
      ----------
      df: pd.DataFrame
          Pandas dataframe with columns for all tasks
      tasks: List[str]
          List of tasks
  
      Returns
      -------
      Tuple[np.ndarray, np.ndarray]
          The tuple is `(w, y)`.
      """
      n_samples = df.shape[0]
      n_tasks = len(tasks)
  
      y = np.hstack(
          [
              np.reshape(np.array(df[task].values), (n_samples, 1))
              for task in tasks
          ]
      )
      w = np.ones((n_samples, n_tasks))
      if y.dtype.kind in ["O", "U"]:
          missing = y == ""
          y[missing] = 0
          w[missing] = 0
  
      return y.astype(float), w.astype(float)
  
imports: import os
  import tempfile
  import zipfile
  import time
  import logging
  import warnings
  from typing import List, Optional, Tuple, Any, Sequence, Union, Iterator
  import pandas
  import numpy
  from deepchem.utils.typing import OneOrMany
  from deepchem.utils.data_utils import load_image_files, load_csv_files, load_json_files, load_sdf_files, unzip_file
  from deepchem.feat import UserDefinedFeaturizer, Featurizer
  from deepchem.data import Dataset, DiskDataset, NumpyDataset, ImageDataset
  from deepchem.feat.molecule_featurizers import OneHotFeaturizer
  from deepchem.utils.genomics_utils import encode_bio_sequence
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_df_to_numpy(df, tasks) and returns: y,  w