code: def dataframe_to_triples(X, schema):
      """Convert DataFrame into triple format.
  
      Parameters
      ----------
      X: pd.DataFrame with headers
      schema: list of tuples
          List of (subject, relation_name, object) tuples where subject and object are in the headers of the data frame.
  
      Example
      -------
      >>> import pandas as pd
      >>> import numpy as np
      >>> from ampligraph.utils.model_utils import dataframe_to_triples
      >>>
      >>> X = pd.read_csv('https://raw.githubusercontent.com/mwaskom/seaborn-data/master/iris.csv')
      >>>
      >>> schema = [['species', 'has_sepal_length', 'sepal_length']]
      >>>
      >>> dataframe_to_triples(X, schema)[0]
      array(['setosa', 'has_sepal_length', '5.1'], dtype='<U16')
      """
      triples = []
      request_headers = set(np.delete(np.array(schema), 1, 1).flatten())
      diff = request_headers.difference(set(X.columns))
      if len(diff) > 0:
          raise Exception(
              "Subject/Object {} are not in data frame headers".format(
                  diff
              )
          )
      for s, p, o in schema:
          triples.extend([[si, p, oi] for si, oi in zip(X[s], X[o])])
      return np.array(triples)
  
file_path: AmpliGraph/ampligraph/utils/model_utils.py
imports: import glob
  import logging
  import os
  import pickle
  import shutil
  from time import gmtime, strftime
  import numpy
  import pandas
  import tensorflow
  from tensorboard.plugins import projector
label_desc: Use image node_id 5 for calling a global function with example usage: dataframe_to_triples(X, schema) and returns: np