class_docstr: Helper class to construct structured array of event indicator and observed time.
docstr: Create structured array from data frame.
  
  Parameters
  ----------
  event : object
      Identifier of column containing event indicator.
  time : object
      Identifier of column containing time.
  data : pandas.DataFrame
      Dataset.
  
  Returns
  -------
  y : np.array
      Structured array with two fields.
docstr_tok: ["Create","structured","array","from","data","frame",".","Parameters","--","--","--","--","--","event",":","object","Identifier","of","column","containing","event","indicator",".","time",":","object","Identifier","of","column","containing","time",".","data",":","pandas.DataFrame","Dataset",".","Returns","--","--","--","-","y",":","np.array","Structured","array","with","two","fields","."]
code: def from_dataframe(event, time, data):
      """Create structured array from data frame.
  
      Parameters
      ----------
      event : object
          Identifier of column containing event indicator.
      time : object
          Identifier of column containing time.
      data : pandas.DataFrame
          Dataset.
  
      Returns
      -------
      y : np.array
          Structured array with two fields.
      """
      if not isinstance(data, pd.DataFrame):
          raise TypeError(
              f"expected pandas.DataFrame, but got {type(data)!r}"
          )
  
      return Surv.from_arrays(
          data.loc[:, event].values,
          data.loc[:, time].values,
          name_event=str(event),
          name_time=str(time),
      )
  
file_path: scikit-survival/sksurv/util.py
imports: import numpy
  import pandas
  from pandas.api.types import CategoricalDtype
  from sklearn.utils import check_array, check_consistent_length
label_desc: Use image node_id 2 for calling the Surv obj's underlying member method code with example usage: obj.from_dataframe(event, time, data) and returns: Surv