class_docstr: DataFrame Accessor & Method for creating Vega-Lite visualizations.
  
  Examples
  --------
  >>> df.vgplot.line()  # doctest: +SKIP
  >>> df.vgplot.area()  # doctest: +SKIP
  >>> df.vgplot.bar()  # doctest: +SKIP
  >>> df.vgplot.barh()  # doctest: +SKIP
  >>> df.vgplot.hist()  # doctest: +SKIP
  >>> df.vgplot.kde()  # doctest: +SKIP
  >>> df.vgplot.density()  # doctest: +SKIP
  >>> df.vgplot.scatter(x, y)  # doctest: +SKIP
  >>> df.vgplot.hexbin(x, y)  # doctest: +SKIP
  
  Plotting methods can also be accessed by calling the accessor as a method
  with the ``kind`` argument: ``df.vgplot(kind='line', **kwds)``
  is equivalent to ``df.vgplot.line(**kwds)``
docstr: Kernel Density Estimate plot for DataFrame data
  
  >>> dataframe.vgplot.kde()  # doctest: +SKIP
  
  Parameters
  ----------
  x : string, optional
      the column to use as the x-axis variable. If not specified, the
      index will be used.
  y : string, optional
      the column to use as the y-axis variable. If not specified, all
      columns (except x if specified) will be used.
  bw_method : str, scalar or callable, optional
      The method used to calculate the estimator bandwidth. This can be
      'scott', 'silverman', a scalar constant or a callable.
      See `scipy.stats.gaussian_kde` for more details.
  alpha : float, optional
      transparency level, 0 <= alpha <= 1
  width : int, optional
      the width of the plot in pixels
  height : int, optional
      the height of the plot in pixels
  ax: altair.Chart, optional
      chart to be overlayed with this vis (convinience method for `chart1 + chart2`)
  
  Returns
  -------
  chart : alt.Chart
      altair chart representation
docstr_tok: ["Kernel","Density","Estimate","plot","for","DataFrame","data",">",">",">","dataframe.vgplot.kde","(",")","#","doctest",":","+SKIP","Parameters","--","--","--","--","--","x",":","string",",","optional","the","column","to","use","as","the","x-axis","variable",".","If","not","specified",",","the","index","will","be","used",".","y",":","string",",","optional","the","column","to","use","as","the","y-axis","variable",".","If","not","specified",",","all","columns","(","except","x","if","specified",")","will","be","used",".","bw_method",":","str",",","scalar","or","callable",",","optional","The","method","used","to","calculate","the","estimator","bandwidth",".","This","can","be","'scott","'",",","'silverman","'",",","a","scalar","constant","or","a","callable",".","See","`","scipy.stats.gaussian_kde","`","for","more","details",".","alpha",":","float",",","optional","transparency","level",",","0","<","=","alpha","<","=","1","width",":","int",",","optional","the","width","of","the","plot","in","pixels","height",":","int",",","optional","the","height","of","the","plot","in","pixels","ax",":","altair.Chart",",","optional","chart","to","be","overlayed","with","this","vis","(","convinience","method","for","`","chart1","+","chart2","`",")","Returns","--","--","--","-","chart",":","alt.Chart","altair","chart","representation"]
code: def kde(
      self,
      x=None,
      y=None,
      bw_method=None,
      alpha=None,
      width=450,
      height=300,
      ax=None,
      **kwds,
  ):
      """Kernel Density Estimate plot for DataFrame data
  
      >>> dataframe.vgplot.kde()  # doctest: +SKIP
  
      Parameters
      ----------
      x : string, optional
          the column to use as the x-axis variable. If not specified, the
          index will be used.
      y : string, optional
          the column to use as the y-axis variable. If not specified, all
          columns (except x if specified) will be used.
      bw_method : str, scalar or callable, optional
          The method used to calculate the estimator bandwidth. This can be
          'scott', 'silverman', a scalar constant or a callable.
          See `scipy.stats.gaussian_kde` for more details.
      alpha : float, optional
          transparency level, 0 <= alpha <= 1
      width : int, optional
          the width of the plot in pixels
      height : int, optional
          the height of the plot in pixels
      ax: altair.Chart, optional
          chart to be overlayed with this vis (convinience method for `chart1 + chart2`)
  
      Returns
      -------
      chart : alt.Chart
          altair chart representation
      """
      from scipy.stats import gaussian_kde as kde
  
      if x is not None:  # ??
          raise NotImplementedError('"x" argument to df.vgplot.kde()')
  
      if y is not None:
          df = self._data[y].to_frame()
      else:
          df = self._data
  
      tmin, tmax = df.min().min(), df.max().max()
      trange = tmax - tmin
      t = np.linspace(tmin - 0.5 * trange, tmax + 0.5 * trange, 1000)
  
      kde_df = pd.DataFrame(
          {
              col: kde(df[col], bw_method=bw_method).evaluate(t)
              for col in df
          },
          index=t,
      )
      kde_df.index.name = " "
  
      f = FramePlotMethods(kde_df)
      return f.line(
          value_name="Density",
          alpha=alpha,
          width=width,
          height=height,
          ax=ax,
          **kwds,
      )
  
imports: import numpy
  import pandas
  import altair
  from ._utils import infer_vegalite_type, unpivot_frame, warn_if_keywords_unused, validate_aggregation
  from ._pandas_internals import PandasObject, register_dataframe_accessor, register_series_accessor
label_desc: Use image node_id 9 for calling the FramePlotMethods obj's underlying member method code with example usage: obj.kde(x, y, bw_method, alpha, width, height, ax) and returns: f