code: def testDataFrame(self):
      edges = pd.DataFrame(
          [["C", "A", 0.4], ["A", "B", 0.1]], columns=[0, 1, "weight"]
      )
      g = Graph.DataFrame(edges, directed=False, use_vids=False)
      self.assertTrue(g.es["weight"] == [0.4, 0.1])
  
      vertices = pd.DataFrame(
          [["A", "blue"], ["B", "yellow"], ["C", "blue"]],
          columns=[0, "color"],
      )
      g = Graph.DataFrame(
          edges, directed=True, vertices=vertices, use_vids=False
      )
      self.assertTrue(g.vs["name"] == ["A", "B", "C"])
      self.assertTrue(g.vs["color"] == ["blue", "yellow", "blue"])
      self.assertTrue(g.es["weight"] == [0.4, 0.1])
  
      # Issue #347
      edges = pd.DataFrame({"source": [1, 2, 3], "target": [4, 5, 6]})
      vertices = pd.DataFrame(
          {
              "node": [1, 2, 3, 4, 5, 6],
              "label": ["1", "2", "3", "4", "5", "6"],
          }
      )[["node", "label"]]
      g = Graph.DataFrame(
          edges, directed=True, vertices=vertices, use_vids=False
      )
      self.assertTrue(g.vs["name"] == [1, 2, 3, 4, 5, 6])
      self.assertTrue(g.vs["label"] == ["1", "2", "3", "4", "5", "6"])
  
      # Vertex names
      edges = pd.DataFrame({"source": [1, 2, 3], "target": [4, 5, 6]})
      g = Graph.DataFrame(edges, use_vids=False)
      self.assertTrue(g.vcount() == 6)
  
      # Vertex ids
      edges = pd.DataFrame({"source": [1, 2, 3], "target": [4, 5, 6]})
      g = Graph.DataFrame(edges)
      self.assertTrue(g.vcount() == 7)
  
      # Graph clone
      g = Graph.Full(n=100, directed=True, loops=True)
      g.vs["name"] = [f"v{i}" for i in range(g.vcount())]
      g.vs["x"] = [float(i) for i in range(g.vcount())]
      g.es["w"] = [1.0] * g.ecount()
      df_edges = g.get_edge_dataframe()
      df_vertices = g.get_vertex_dataframe()
      g_clone = Graph.DataFrame(df_edges, g.is_directed(), df_vertices)
      self.assertTrue(df_edges.equals(g_clone.get_edge_dataframe()))
      self.assertTrue(
          df_vertices.equals(g_clone.get_vertex_dataframe())
      )
  
      # pandas Int64 data type
      edges = pd.DataFrame(
          np.array([[0, 1], [1, 1], [1, 2]]), dtype="Int64"
      )
      g = Graph.DataFrame(edges)
      self.assertTrue(g.vcount() == 3)
  
      # dataframe with both int data and str data
      edges = pd.DataFrame(
          {"source": [1, 2, 2], "target": ["A", "B", "A"]}
      )
      g = Graph.DataFrame(edges, use_vids=False)
      self.assertTrue(g.vs["name"] == [1, "A", 2, "B"])
  
      # Invalid input
      with self.assertRaisesRegex(ValueError, "two columns"):
          edges = pd.DataFrame({"source": [1, 2, 3]})
          Graph.DataFrame(edges)
      with self.assertRaisesRegex(ValueError, "one column"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          Graph.DataFrame(edges, vertices=pd.DataFrame())
      with self.assertRaisesRegex(TypeError, "integers"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          ).astype(str)
          Graph.DataFrame(edges)
      with self.assertRaisesRegex(ValueError, "negative"):
          edges = -pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          Graph.DataFrame(edges)
      with self.assertRaisesRegex(TypeError, "integers"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          vertices = pd.DataFrame({0: [1, 2, 3]}, index=["1", "2", "3"])
          Graph.DataFrame(edges, vertices=vertices)
      with self.assertRaisesRegex(ValueError, "negative"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          vertices = pd.DataFrame({0: [1, 2, 3]}, index=[-1, 2, 3])
          Graph.DataFrame(edges, vertices=vertices)
      with self.assertRaisesRegex(ValueError, "sequence"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          vertices = pd.DataFrame({0: [1, 2, 3]}, index=[1, 2, 4])
          Graph.DataFrame(edges, vertices=vertices)
      with self.assertRaisesRegex(TypeError, "integers"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          vertices = pd.DataFrame(
              {0: [1, 2, 3]},
              index=pd.MultiIndex.from_tuples([(1, 1), (2, 2), (3, 3)]),
          )
          Graph.DataFrame(edges, vertices=vertices)
      with self.assertRaisesRegex(ValueError, "unique"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          vertices = pd.DataFrame({0: [1, 2, 2]})
          Graph.DataFrame(edges, vertices=vertices, use_vids=False)
      with self.assertRaisesRegex(ValueError, "already contains"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          vertices = pd.DataFrame({0: [1, 2, 3], "name": [1, 2, 2]})
          Graph.DataFrame(edges, vertices=vertices, use_vids=False)
      with self.assertRaisesRegex(ValueError, "missing from"):
          edges = pd.DataFrame(
              {"source": [1, 2, 3], "target": [4, 5, 6]}
          )
          vertices = pd.DataFrame({0: [1, 2, 3]}, index=[0, 1, 2])
          Graph.DataFrame(edges, vertices=vertices)
      with self.assertRaisesRegex(ValueError, "null"):
          edges = pd.DataFrame(
              np.array([[0, 1], [1, np.nan], [1, 2]]), dtype="Int64"
          )
          Graph.DataFrame(edges)
  
imports: import unittest
  from igraph import Graph, InternalError
label_desc: Use image node_id 21 for calling the GeneratorTests obj's underlying member method code with example usage: obj.testDataFrame() without return types