class_docstr: The core class of DeepGraph (dg).
  
  This class encapsulates the graph representation as ``pandas.DataFrame``
  objects in its attributes ``v`` and ``e``. It can be initialized with a
  node table ``v``, whose rows represent the nodes of the graph, as well
  as an edge table ``e``, whose rows represent edges between the nodes.
  
  Given a node table ``v``, it provides methods to iteratively compute
  pairwise relations between the nodes using arbitrary, user-defined
  functions. These methods provide arguments to parallelize the
  computation and control memory consumption (see ``create_edges`` and
  ``create_edges_ft``).
  
  Also provides methods to partition nodes, edges or an entire graph by
  the graph's properties and labels, and to create common network
  representations and graph objects of popular Python network packages.
  
  Furthermore, it provides methods to visualize graphs and their
  properties and to benchmark the graph construction parameters.
  
  Optionally, the convenience parameter ``supernode_labels_by`` can be
  passed, creating supernode labels by enumerating all distinct (tuples
  of) values of a (multiple) column(s) of ``v`` . Superedge labels can be
  created analogously, by passing the parameter ``superedge_labels_by``.
  
  Parameters
  ----------
  v : pandas.DataFrame or pandas.HDFStore, optional (default=None)
      The node table, a table representation of the nodes of a graph. The
      index of ``v`` must be unique and represents the node indices. The
      column names of ``v`` represent the types of features of the nodes,
      and each cell represents a feature of a node. Only a reference to
      the input DataFrame is created, not a copy. May also be a
      ``pandas.HDFStore``, but only ``create_edges`` and
      ``create_edges_ft`` may then be used (so far).
  
  e : pandas.DataFrame, optional (default=None)
      The edge table, a table representation of the edges between the
      nodes given by ``v``. Its index has to be a
      ``pandas.core.index.MultiIndex``, whose first level contains the
      indices of the source nodes, and the second level contains the
      indices of the target nodes. Each row of ``e`` represents an edge,
      column names of ``e`` represent the types of relations of the edges,
      and each cell in ``e`` represents a relation of an edge. Only a
      reference to the input DataFrame is created, not a copy.
  
  supernode_labels_by : dict, optional (default=None)
      A dictionary whose keys are strings and their values are (lists of)
      column names of ``v``. Appends a column to ``v`` for each key, whose
      values correspond to supernode labels, enumerating all distinct
      (tuples of) values of the column(s) given by the dict's value.
  
  superedge_labels_by : dict, optional (default=None)
      A dictionary whose keys are strings and their values are (lists of)
      column names of ``e``. Appends a column to ``e`` for each key, whose
      values correspond to superedge labels enumerating all distinct
      (tuples of) values of the column(s) given by the dict's value.
  
  Attributes
  ----------
  v : pandas.DataFrame
      See Parameters.
  
  e : pandas.DataFrame
      See Parameters.
  
  n : int
      Property: Number of nodes.
  
  m : int
      Property: Number of edges.
  
  f : pd.DataFrame
      Property: types of features and number of features of corresponding
      type.
  
  r : pd.DataFrame
      Property: types of relations and number of relations of
      corresponding type.
class_docstr_tok: ["The","core","class","of","DeepGraph","(","dg",")",".","This","class","encapsulates","the","graph","representation","as","``","pandas.DataFrame","``","objects","in","its","attributes","``","v","``","and","``","e","``",".","It","can","be","initialized","with","a","node","table","``","v","``",",","whose","rows","represent","the","nodes","of","the","graph",",","as","well","as","an","edge","table","``","e","``",",","whose","rows","represent","edges","between","the","nodes",".","Given","a","node","table","``","v","``",",","it","provides","methods","to","iteratively","compute","pairwise","relations","between","the","nodes","using","arbitrary",",","user-defined","functions",".","These","methods","provide","arguments","to","parallelize","the","computation","and","control","memory","consumption","(","see","``","create_edges","``","and","``","create_edges_ft","``",")",".","Also","provides","methods","to","partition","nodes",",","edges","or","an","entire","graph","by","the","graph","'s","properties","and","labels",",","and","to","create","common","network","representations","and","graph","objects","of","popular","Python","network","packages",".","Furthermore",",","it","provides","methods","to","visualize","graphs","and","their","properties","and","to","benchmark","the","graph","construction","parameters",".","Optionally",",","the","convenience","parameter","``","supernode_labels_by","``","can","be","passed",",","creating","supernode","labels","by","enumerating","all","distinct","(","tuples","of",")","values","of","a","(","multiple",")","column","(","s",")","of","``","v","``",".","Superedge","labels","can","be","created","analogously",",","by","passing","the","parameter","``","superedge_labels_by","``",".","Parameters","--","--","--","--","--","v",":","pandas.DataFrame","or","pandas.HDFStore",",","optional","(","default=None",")","The","node","table",",","a","table","representation","of","the","nodes","of","a","graph",".","The","index","of","``","v","``","must","be","unique","and","represents","the","node","indices",".","The","column","names","of","``","v","``","represent","the","types","of","features","of","the","nodes",",","and","each","cell","represents","a","feature","of","a","node",".","Only","a","reference","to","the","input","DataFrame","is","created",",","not","a","copy",".","May","also","be","a","``","pandas.HDFStore","``",",","but","only","``","create_edges","``","and","``","create_edges_ft","``","may","then","be","used","(","so","far",")",".","e",":","pandas.DataFrame",",","optional","(","default=None",")","The","edge","table",",","a","table","representation","of","the","edges","between","the","nodes","given","by","``","v","``",".","Its","index","has","to","be","a","``","pandas.core.index.MultiIndex","``",",","whose","first","level","contains","the","indices","of","the","source","nodes",",","and","the","second","level","contains","the","indices","of","the","target","nodes",".","Each","row","of","``","e","``","represents","an","edge",",","column","names","of","``","e","``","represent","the","types","of","relations","of","the","edges",",","and","each","cell","in","``","e","``","represents","a","relation","of","an","edge",".","Only","a","reference","to","the","input","DataFrame","is","created",",","not","a","copy",".","supernode_labels_by",":","dict",",","optional","(","default=None",")","A","dictionary","whose","keys","are","strings","and","their","values","are","(","lists","of",")","column","names","of","``","v","``",".","Appends","a","column","to","``","v","``","for","each","key",",","whose","values","correspond","to","supernode","labels",",","enumerating","all","distinct","(","tuples","of",")","values","of","the","column","(","s",")","given","by","the","dict","'s","value",".","superedge_labels_by",":","dict",",","optional","(","default=None",")","A","dictionary","whose","keys","are","strings","and","their","values","are","(","lists","of",")","column","names","of","``","e","``",".","Appends","a","column","to","``","e","``","for","each","key",",","whose","values","correspond","to","superedge","labels","enumerating","all","distinct","(","tuples","of",")","values","of","the","column","(","s",")","given","by","the","dict","'s","value",".","Attributes","--","--","--","--","--","v",":","pandas.DataFrame","See","Parameters",".","e",":","pandas.DataFrame","See","Parameters",".","n",":","int","Property",":","Number","of","nodes",".","m",":","int","Property",":","Number","of","edges",".","f",":","pd.DataFrame","Property",":","types","of","features","and","number","of","features","of","corresponding","type",".","r",":","pd.DataFrame","Property",":","types","of","relations","and","number","of","relations","of","corresponding","type","."]
docstr: Plot nodes and corresponding edges by groups.
  
  Create a generator of scatter plots of the nodes in ``v``, split in
  groups by ``v``.groupby(``by``). If edges is set True, also create a
  quiver plot of each group's corresponding edges.
  
  The xy-coordinates of the scatter plots are determined by the values of
  ``v[x]`` and ``v[y]``, where ``x`` and ``y`` are column names of ``v``
  (the arrow's coordinates are determined automatically).
  
  In order to map colors to the arrows, either ``C`` or ``C_split_0``
  can be be passed, an array of the same length as ``e``. Passing ``C``
  creates a single quiver plot (qu). Passing ``C_split_0`` creates two
  separate quiver plots, one for all edges where ``C_split_0`` == 0
  (qu_0), and one for all other edges (qu). By default, the arrows of
  qu_0 have no head, indicating "undirected" edges. This can be useful,
  for instance, when ``C_split_0`` represents an array of temporal
  distances.
  
  When mapping colors to arrows by setting ``C`` (or ``C_split_0``),
  `clim` is automatically set to the min and max values of the entire
  array. In case one wants clim to be set to min and max values for each
  group's colors, one may explicitly pass `clim` = None to
  ``kwds_quiver``.
  
  The same behaviour occurs when passing a sequence of ``g.n`` Numbers as
  colors `c` to ``kwds_scatter``. In that case, `vmin` and `vmax` are
  automatically set to `c`.min() and `c`.max() of all nodes. Explicitly
  setting `vmin` and `vmax` to `None`, the min and max values of the
  groups' color arrays are used.
  
  In order to control the plotting parameters of the scatter, quiver
  and/or quiver_0 plots, one may pass keyword arguments by setting
  ``kwds_scatter``, ``kwds_quiver`` and/or ``kwds_quiver_0``.
  
  If ``passable_ax`` is True, create a generator of functions. Each
  function takes a matplotlib axes object as input, and returns a
  scatter/quiver plot.
  
  Parameters
  ----------
  x : int or str
      A column name of ``v``, determining the x-coordinates of the
      scatter plot of nodes.
  
  y : int or str
      A column name of ``v``, determining the y-coordinates of the
      scatter plot of nodes.
  
  by : array_like
      Column name(s) of ``v``, determining the groups to create plots of.
  
  edges : bool, optional (default=True)
      Whether to create a quiver plot (2-D field of arrows) of the edges
      between the nodes.
  
  C : array_like, optional (default=None)
      An optional array used to map colors to the arrows. Must have the
      same length es ``e``. Has no effect if ``C_split_0`` is passed as
      an argument.
  
  C_split_0 : array_like, optional (default=None)
      An optional array used to map colors to the arrows. Must have the
      same length es ``e``. If this parameter is passed, ``C`` has no
      effect, and two separate quiver plots are created (qu and qu_0).
  
  kwds_scatter : dict, optional (default=None)
      kwargs to be passed to scatter.
  
  kwds_quiver : dict, optional (default=None)
      kwargs to be passed to quiver (qu).
  
  kwds_quiver_0 : dict, optional (default=None)
      kwargs to be passed to quiver (qu_0). Only has an effect if
      ``C_split_0`` has been set.
  
  passable_ax : bool, optional (default=False)
      If True, return a generator of functions. Each function takes a
      matplotlib axes object as input, and returns a dict of matplotlib
      objects.
  
  Returns
  -------
  obj : generator
      If ``C_split_0`` has been passed, return a generator of dicts of
      matplotlib objects with the following keys: ['fig', 'ax', 'pc',
      'qu', 'qu_0', 'group']. Otherwise, return a generator of dicts
      with keys: ['fig', 'ax', 'pc', 'qu', 'group'].
      If ``passable_ax`` is True, return a generator of functions. Each
      function takes a matplotlib axes object as input, and returns a
      dict as described above.
  
  Notes
  -----
  When passing ``C_split_0``, the color of the arrows in qu_0 can be set
  by passing the keyword argument `color` to ``kwds_quiver_0``. The color
  of the arrows in qu, however, are determined by ``C_split_0``.
  
  The default drawing order is set to:
  1. quiver_0 (zorder=1)
  2. quiver (zorder=2)
  3. scatter (zorder=3)
  This order can be changed by setting the ``zorder`` in
  ``kwds_quiver_0``, ``kwds_quiver`` and/or ``kwds_scatter``.
  See also http://matplotlib.org/examples/pylab_examples/zorder_demo.html
  
  See also
  --------
  append_binning_labels_v
  plot_2d
  plot_3d
  plot_map
  plot_map_generator
docstr_tok: ["Plot","nodes","and","corresponding","edges","by","groups",".","Create","a","generator","of","scatter","plots","of","the","nodes","in","``","v","``",",","split","in","groups","by","``","v","``",".groupby","(","``","by","``",")",".","If","edges","is","set","True",",","also","create","a","quiver","plot","of","each","group","'s","corresponding","edges",".","The","xy-coordinates","of","the","scatter","plots","are","determined","by","the","values","of","``","v","[","x","]","``","and","``","v","[","y","]","``",",","where","``","x","``","and","``","y","``","are","column","names","of","``","v","``","(","the","arrow","'s","coordinates","are","determined","automatically",")",".","In","order","to","map","colors","to","the","arrows",",","either","``","C","``","or","``","C_split_0","``","can","be","be","passed",",","an","array","of","the","same","length","as","``","e","``",".","Passing","``","C","``","creates","a","single","quiver","plot","(","qu",")",".","Passing","``","C_split_0","``","creates","two","separate","quiver","plots",",","one","for","all","edges","where","``","C_split_0","``","==","0","(","qu_0",")",",","and","one","for","all","other","edges","(","qu",")",".","By","default",",","the","arrows","of","qu_0","have","no","head",",","indicating","``","undirected","''","edges",".","This","can","be","useful",",","for","instance",",","when","``","C_split_0","``","represents","an","array","of","temporal","distances",".","When","mapping","colors","to","arrows","by","setting","``","C","``","(","or","``","C_split_0","``",")",",","`","clim","`","is","automatically","set","to","the","min","and","max","values","of","the","entire","array",".","In","case","one","wants","clim","to","be","set","to","min","and","max","values","for","each","group","'s","colors",",","one","may","explicitly","pass","`","clim","`","=","None","to","``","kwds_quiver","``",".","The","same","behaviour","occurs","when","passing","a","sequence","of","``","g.n","``","Numbers","as","colors","`","c","`","to","``","kwds_scatter","``",".","In","that","case",",","`","vmin","`","and","`","vmax","`","are","automatically","set","to","`","c","`",".min","(",")","and","`","c","`",".max","(",")","of","all","nodes",".","Explicitly","setting","`","vmin","`","and","`","vmax","`","to","`","None","`",",","the","min","and","max","values","of","the","groups","'","color","arrays","are","used",".","In","order","to","control","the","plotting","parameters","of","the","scatter",",","quiver","and\/or","quiver_0","plots",",","one","may","pass","keyword","arguments","by","setting","``","kwds_scatter","``",",","``","kwds_quiver","``","and\/or","``","kwds_quiver_0","``",".","If","``","passable_ax","``","is","True",",","create","a","generator","of","functions",".","Each","function","takes","a","matplotlib","axes","object","as","input",",","and","returns","a","scatter\/quiver","plot",".","Parameters","--","--","--","--","--","x",":","int","or","str","A","column","name","of","``","v","``",",","determining","the","x-coordinates","of","the","scatter","plot","of","nodes",".","y",":","int","or","str","A","column","name","of","``","v","``",",","determining","the","y-coordinates","of","the","scatter","plot","of","nodes",".","by",":","array_like","Column","name","(","s",")","of","``","v","``",",","determining","the","groups","to","create","plots","of",".","edges",":","bool",",","optional","(","default=True",")","Whether","to","create","a","quiver","plot","(","2-D","field","of","arrows",")","of","the","edges","between","the","nodes",".","C",":","array_like",",","optional","(","default=None",")","An","optional","array","used","to","map","colors","to","the","arrows",".","Must","have","the","same","length","es","``","e","``",".","Has","no","effect","if","``","C_split_0","``","is","passed","as","an","argument",".","C_split_0",":","array_like",",","optional","(","default=None",")","An","optional","array","used","to","map","colors","to","the","arrows",".","Must","have","the","same","length","es","``","e","``",".","If","this","parameter","is","passed",",","``","C","``","has","no","effect",",","and","two","separate","quiver","plots","are","created","(","qu","and","qu_0",")",".","kwds_scatter",":","dict",",","optional","(","default=None",")","kwargs","to","be","passed","to","scatter",".","kwds_quiver",":","dict",",","optional","(","default=None",")","kwargs","to","be","passed","to","quiver","(","qu",")",".","kwds_quiver_0",":","dict",",","optional","(","default=None",")","kwargs","to","be","passed","to","quiver","(","qu_0",")",".","Only","has","an","effect","if","``","C_split_0","``","has","been","set",".","passable_ax",":","bool",",","optional","(","default=False",")","If","True",",","return","a","generator","of","functions",".","Each","function","takes","a","matplotlib","axes","object","as","input",",","and","returns","a","dict","of","matplotlib","objects",".","Returns","--","--","--","-","obj",":","generator","If","``","C_split_0","``","has","been","passed",",","return","a","generator","of","dicts","of","matplotlib","objects","with","the","following","keys",":","[","'fig","'",",","'ax","'",",","'pc","'",",","'qu","'",",","'qu_0","'",",","'group","'","]",".","Otherwise",",","return","a","generator","of","dicts","with","keys",":","[","'fig","'",",","'ax","'",",","'pc","'",",","'qu","'",",","'group","'","]",".","If","``","passable_ax","``","is","True",",","return","a","generator","of","functions",".","Each","function","takes","a","matplotlib","axes","object","as","input",",","and","returns","a","dict","as","described","above",".","Notes","--","--","-","When","passing","``","C_split_0","``",",","the","color","of","the","arrows","in","qu_0","can","be","set","by","passing","the","keyword","argument","`","color","`","to","``","kwds_quiver_0","``",".","The","color","of","the","arrows","in","qu",",","however",",","are","determined","by","``","C_split_0","``",".","The","default","drawing","order","is","set","to",":","1.","quiver_0","(","zorder=1",")","2.","quiver","(","zorder=2",")","3.","scatter","(","zorder=3",")","This","order","can","be","changed","by","setting","the","``","zorder","``","in","``","kwds_quiver_0","``",",","``","kwds_quiver","``","and\/or","``","kwds_scatter","``",".","See","also","http",":","\/\/matplotlib.org\/examples\/pylab_examples\/zorder_demo.html","See","also","--","--","--","--","append_binning_labels_v","plot_2d","plot_3d","plot_map","plot_map_generator"]
code: def plot_2d_generator(
      self,
      x,
      y,
      by,
      edges=False,
      C=None,
      C_split_0=None,
      kwds_scatter=None,
      kwds_quiver=None,
      kwds_quiver_0=None,
      passable_ax=False,
  ):
      """Plot nodes and corresponding edges by groups.
  
      Create a generator of scatter plots of the nodes in ``v``, split in
      groups by ``v``.groupby(``by``). If edges is set True, also create a
      quiver plot of each group's corresponding edges.
  
      The xy-coordinates of the scatter plots are determined by the values of
      ``v[x]`` and ``v[y]``, where ``x`` and ``y`` are column names of ``v``
      (the arrow's coordinates are determined automatically).
  
      In order to map colors to the arrows, either ``C`` or ``C_split_0``
      can be be passed, an array of the same length as ``e``. Passing ``C``
      creates a single quiver plot (qu). Passing ``C_split_0`` creates two
      separate quiver plots, one for all edges where ``C_split_0`` == 0
      (qu_0), and one for all other edges (qu). By default, the arrows of
      qu_0 have no head, indicating "undirected" edges. This can be useful,
      for instance, when ``C_split_0`` represents an array of temporal
      distances.
  
      When mapping colors to arrows by setting ``C`` (or ``C_split_0``),
      `clim` is automatically set to the min and max values of the entire
      array. In case one wants clim to be set to min and max values for each
      group's colors, one may explicitly pass `clim` = None to
      ``kwds_quiver``.
  
      The same behaviour occurs when passing a sequence of ``g.n`` Numbers as
      colors `c` to ``kwds_scatter``. In that case, `vmin` and `vmax` are
      automatically set to `c`.min() and `c`.max() of all nodes. Explicitly
      setting `vmin` and `vmax` to `None`, the min and max values of the
      groups' color arrays are used.
  
      In order to control the plotting parameters of the scatter, quiver
      and/or quiver_0 plots, one may pass keyword arguments by setting
      ``kwds_scatter``, ``kwds_quiver`` and/or ``kwds_quiver_0``.
  
      If ``passable_ax`` is True, create a generator of functions. Each
      function takes a matplotlib axes object as input, and returns a
      scatter/quiver plot.
  
      Parameters
      ----------
      x : int or str
          A column name of ``v``, determining the x-coordinates of the
          scatter plot of nodes.
  
      y : int or str
          A column name of ``v``, determining the y-coordinates of the
          scatter plot of nodes.
  
      by : array_like
          Column name(s) of ``v``, determining the groups to create plots of.
  
      edges : bool, optional (default=True)
          Whether to create a quiver plot (2-D field of arrows) of the edges
          between the nodes.
  
      C : array_like, optional (default=None)
          An optional array used to map colors to the arrows. Must have the
          same length es ``e``. Has no effect if ``C_split_0`` is passed as
          an argument.
  
      C_split_0 : array_like, optional (default=None)
          An optional array used to map colors to the arrows. Must have the
          same length es ``e``. If this parameter is passed, ``C`` has no
          effect, and two separate quiver plots are created (qu and qu_0).
  
      kwds_scatter : dict, optional (default=None)
          kwargs to be passed to scatter.
  
      kwds_quiver : dict, optional (default=None)
          kwargs to be passed to quiver (qu).
  
      kwds_quiver_0 : dict, optional (default=None)
          kwargs to be passed to quiver (qu_0). Only has an effect if
          ``C_split_0`` has been set.
  
      passable_ax : bool, optional (default=False)
          If True, return a generator of functions. Each function takes a
          matplotlib axes object as input, and returns a dict of matplotlib
          objects.
  
      Returns
      -------
      obj : generator
          If ``C_split_0`` has been passed, return a generator of dicts of
          matplotlib objects with the following keys: ['fig', 'ax', 'pc',
          'qu', 'qu_0', 'group']. Otherwise, return a generator of dicts
          with keys: ['fig', 'ax', 'pc', 'qu', 'group'].
          If ``passable_ax`` is True, return a generator of functions. Each
          function takes a matplotlib axes object as input, and returns a
          dict as described above.
  
      Notes
      -----
      When passing ``C_split_0``, the color of the arrows in qu_0 can be set
      by passing the keyword argument `color` to ``kwds_quiver_0``. The color
      of the arrows in qu, however, are determined by ``C_split_0``.
  
      The default drawing order is set to:
      1. quiver_0 (zorder=1)
      2. quiver (zorder=2)
      3. scatter (zorder=3)
      This order can be changed by setting the ``zorder`` in
      ``kwds_quiver_0``, ``kwds_quiver`` and/or ``kwds_scatter``.
      See also http://matplotlib.org/examples/pylab_examples/zorder_demo.html
  
      See also
      --------
      append_binning_labels_v
      plot_2d
      plot_3d
      plot_map
      plot_map_generator
  
      """
  
      return self._plot_2d_generator(
          is_map=False,
          x=x,
          y=y,
          by=by,
          edges=edges,
          C=C,
          C_split_0=C_split_0,
          kwds_basemap=None,
          kwds_scatter=kwds_scatter,
          kwds_quiver=kwds_quiver,
          kwds_quiver_0=kwds_quiver_0,
          passable_ax=passable_ax,
      )
  
imports: import inspect
  import os
  from datetime import datetime
  from itertools import chain
  from deepgraph.iterators_and_indexers import _matrix_iterator, _ft_iterator, _iter_edges, _initiate_create_edges, _aggregate_super_table
  from deepgraph.utils import _is_array_like, _dic_translator, _create_bin_edges, _flatten
  import numpy
  import pandas
label_desc: Use image node_id 22 for calling the DeepGraph obj's underlying member method code with example usage: obj.plot_2d_generator(x, y, by, edges, C, C_split_0, kwds_scatter, kwds_quiver, kwds_quiver_0, passable_ax) and returns: self