Guest User

Untitled

a guest
Apr 13th, 2022
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 5.22 KB | None | 0 0
  1. ---------------------------------------------------------------------------
  2. KeyError                                  Traceback (most recent call last)
  3. Input In [8], in <cell line: 1>()
  4. ----> 1 from binscatter import binscatterplot
  5.  
  6. File ~/.virtualenvs/general/lib/python3.8/site-packages/binscatter/__init__.py:1, in <module>
  7. ----> 1 from .binscatter import binscatterplot
  8.       2 name = "binscatter"
  9.  
  10. File ~/.virtualenvs/general/lib/python3.8/site-packages/binscatter/binscatter.py:433, in <module>
  11.     352     ax = plotter.plot(
  12.     353         ax,
  13.     354         truncate=truncate,
  14.    (...)
  15.     360         raw=raw,
  16.     361     )
  17.     363     return ax
  18.     366 binscatterplot.__doc__ = f"""\
  19.    367 Plot data via binned scatterplot.
  20.    368
  21.    369 See https://arxiv.org/pdf/1902.09608.pdf for details.
  22.    370 Site and documentation for binsreg: https://sites.google.com/site/nppackages/binsreg/.
  23.    371
  24.    372 Parameters
  25.    373 ----------
  26.    374 x : Union[str, np.array]
  27.    375     Independent variable
  28.    376 y : Union[str, np.array]
  29.    377     Dependent variable
  30.    378 covariates : Union[str, List], optional
  31.    379     List of additional covariates to control for, by default None
  32.    380 hue : Union[str, np.array], optional
  33.    381     Variable for groupings of data, by default None
  34.    382 fit_spline : bool, optional
  35.    383     Equivalent to setting line=(3, 3) and cb=(3, 3) for fitting cubic splines,
  36.    384     If fit_spline is True, line and cb arguments are ignored; by default True
  37.    385 fit_reg : bool, optional
  38.    386     Equivalent to setting polyreg=1. If True, polyreg is ignored, by default False
  39.    387 disp_ci : bool, optional
  40.    388     Equivalent to setting ci=(3, 3). If True, ci is ignored, by default True
  41.    389 data : pd.DataFrame, optional
  42.    390     DataFrame for the data, must be specified if x, y are not iterables, by default None
  43.    391 raw : bool, optional
  44.    392     Whether or not raw data is plotted in the background, by default True.
  45.    393     Mean-shifted residualized data is plotted in the presence of additional covariates:
  46.    394     The residuals of z (for z being x, y) regressed on intercept and covariates are
  47.    395     recentered at the original mean of z (instead of zero) and plotted.
  48.    396 dots : tuple, optional
  49.    397     Argument passed to binsreg in R, by default (0, 0)
  50.    398 line : tuple, optional
  51.    399     Argument passed to binsreg in R, by default rpy2.rinterface.NULL
  52.    400 ci : tuple, optional
  53.    401     Argument passed to binsreg in R, by default rpy2.rinterface.NULL
  54.    402 cb : tuple, optional
  55.    403     Argument passed to binsreg in R, by default rpy2.rinterface.NULL
  56.    404 nbins : int, optional
  57.    405     Argument passed to binsreg in R, by default rpy2.rinterface.NULL
  58.    406 ax : matplotlib.pyplot.Axes, optional
  59.    407     Axes object for the plot, by default None
  60.    408 color : str, optional
  61.    409     Color of the plot, by default None
  62.    410 truncate : bool, optional
  63.    411     Whether to truncate the line fits (spline or global regression) at the
  64.    412     left and right most bins, by default False
  65.    413 legend_args : dict, optional
  66.    414     Arguments passed to ax.legend(), by default dict(frameon=False)
  67.    415 scatter_args : dict, optional
  68.    416     Arguments passed to ax.scatter for the binned dots, by default dict()
  69.    417 line_args : dict, optional
  70.    418     Arguments passed to ax.plot for the spline fit, by default dict()
  71.    419 poly_args : dict, optional
  72.    420     Arguments passed to ax.plot for the global regression fit, by default dict()
  73.    421 ci_args : dict, optional
  74.    422     Arguments passed to ax.errorbar for the CI on binned points, by default dict()
  75.    423 **kwargs:
  76.    424     Additional arguments passed to binsreg in R
  77.    425
  78.    426 Returns
  79.    427 -------
  80.    428 ax: plt.Axes
  81.    429     The Axes for the plot
  82.    430
  83.    431 `binsreg` documentation in R
  84.    432 ----------------------------
  85. --> 433 {binsreg.binsreg.__doc__}
  86.    434 """
  87.  
  88. File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/functions.py:54, in DocstringProperty.__get__(self, obj, objtype)
  89.      52     return self.class_doc
  90.      53 else:
  91. ---> 54     return self.fget(obj)
  92.  
  93. File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/functions.py:255, in DocumentedSTFunction.__doc__(self)
  94.     251     doc.append(' '.join(('  ', item.name, ': ', description)))
  95.     252     doc.append('')
  96.     254 doc.append(
  97. --> 255     help.docstring(self.__rpackagename__,
  98.     256                    self.__rname__,
  99.     257                    sections=['\\details'])
  100.     258 )
  101.     260 return os.linesep.join(doc)
  102.  
  103. File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/help.py:428, in docstring(package, alias, sections)
  104.     426     package = Package(package)
  105.     427 page = package.fetch(alias)
  106. --> 428 return page.to_docstring(sections)
  107.  
  108. File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/help.py:293, in Page.to_docstring(self, section_names)
  109.     291 s.append(os.linesep)
  110.     292 s.append(os.linesep)
  111. --> 293 walk(self.sections[name])
  112.     294 s.append(os.linesep)
  113.     295 s.append(os.linesep)
  114.  
  115. KeyError: '\\details'
Advertisement
Add Comment
Please, Sign In to add comment