Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------------------------------------------------------
- KeyError Traceback (most recent call last)
- Input In [8], in <cell line: 1>()
- ----> 1 from binscatter import binscatterplot
- File ~/.virtualenvs/general/lib/python3.8/site-packages/binscatter/__init__.py:1, in <module>
- ----> 1 from .binscatter import binscatterplot
- 2 name = "binscatter"
- File ~/.virtualenvs/general/lib/python3.8/site-packages/binscatter/binscatter.py:433, in <module>
- 352 ax = plotter.plot(
- 353 ax,
- 354 truncate=truncate,
- (...)
- 360 raw=raw,
- 361 )
- 363 return ax
- 366 binscatterplot.__doc__ = f"""\
- 367 Plot data via binned scatterplot.
- 368
- 369 See https://arxiv.org/pdf/1902.09608.pdf for details.
- 370 Site and documentation for binsreg: https://sites.google.com/site/nppackages/binsreg/.
- 371
- 372 Parameters
- 373 ----------
- 374 x : Union[str, np.array]
- 375 Independent variable
- 376 y : Union[str, np.array]
- 377 Dependent variable
- 378 covariates : Union[str, List], optional
- 379 List of additional covariates to control for, by default None
- 380 hue : Union[str, np.array], optional
- 381 Variable for groupings of data, by default None
- 382 fit_spline : bool, optional
- 383 Equivalent to setting line=(3, 3) and cb=(3, 3) for fitting cubic splines,
- 384 If fit_spline is True, line and cb arguments are ignored; by default True
- 385 fit_reg : bool, optional
- 386 Equivalent to setting polyreg=1. If True, polyreg is ignored, by default False
- 387 disp_ci : bool, optional
- 388 Equivalent to setting ci=(3, 3). If True, ci is ignored, by default True
- 389 data : pd.DataFrame, optional
- 390 DataFrame for the data, must be specified if x, y are not iterables, by default None
- 391 raw : bool, optional
- 392 Whether or not raw data is plotted in the background, by default True.
- 393 Mean-shifted residualized data is plotted in the presence of additional covariates:
- 394 The residuals of z (for z being x, y) regressed on intercept and covariates are
- 395 recentered at the original mean of z (instead of zero) and plotted.
- 396 dots : tuple, optional
- 397 Argument passed to binsreg in R, by default (0, 0)
- 398 line : tuple, optional
- 399 Argument passed to binsreg in R, by default rpy2.rinterface.NULL
- 400 ci : tuple, optional
- 401 Argument passed to binsreg in R, by default rpy2.rinterface.NULL
- 402 cb : tuple, optional
- 403 Argument passed to binsreg in R, by default rpy2.rinterface.NULL
- 404 nbins : int, optional
- 405 Argument passed to binsreg in R, by default rpy2.rinterface.NULL
- 406 ax : matplotlib.pyplot.Axes, optional
- 407 Axes object for the plot, by default None
- 408 color : str, optional
- 409 Color of the plot, by default None
- 410 truncate : bool, optional
- 411 Whether to truncate the line fits (spline or global regression) at the
- 412 left and right most bins, by default False
- 413 legend_args : dict, optional
- 414 Arguments passed to ax.legend(), by default dict(frameon=False)
- 415 scatter_args : dict, optional
- 416 Arguments passed to ax.scatter for the binned dots, by default dict()
- 417 line_args : dict, optional
- 418 Arguments passed to ax.plot for the spline fit, by default dict()
- 419 poly_args : dict, optional
- 420 Arguments passed to ax.plot for the global regression fit, by default dict()
- 421 ci_args : dict, optional
- 422 Arguments passed to ax.errorbar for the CI on binned points, by default dict()
- 423 **kwargs:
- 424 Additional arguments passed to binsreg in R
- 425
- 426 Returns
- 427 -------
- 428 ax: plt.Axes
- 429 The Axes for the plot
- 430
- 431 `binsreg` documentation in R
- 432 ----------------------------
- --> 433 {binsreg.binsreg.__doc__}
- 434 """
- File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/functions.py:54, in DocstringProperty.__get__(self, obj, objtype)
- 52 return self.class_doc
- 53 else:
- ---> 54 return self.fget(obj)
- File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/functions.py:255, in DocumentedSTFunction.__doc__(self)
- 251 doc.append(' '.join((' ', item.name, ': ', description)))
- 252 doc.append('')
- 254 doc.append(
- --> 255 help.docstring(self.__rpackagename__,
- 256 self.__rname__,
- 257 sections=['\\details'])
- 258 )
- 260 return os.linesep.join(doc)
- File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/help.py:428, in docstring(package, alias, sections)
- 426 package = Package(package)
- 427 page = package.fetch(alias)
- --> 428 return page.to_docstring(sections)
- File ~/.virtualenvs/general/lib/python3.8/site-packages/rpy2/robjects/help.py:293, in Page.to_docstring(self, section_names)
- 291 s.append(os.linesep)
- 292 s.append(os.linesep)
- --> 293 walk(self.sections[name])
- 294 s.append(os.linesep)
- 295 s.append(os.linesep)
- KeyError: '\\details'
Advertisement
Add Comment
Please, Sign In to add comment