Module pandas_profiling.report.presentation.core.preview
Expand source code
from typing import Union, Any
from pandas_profiling.report.presentation.abstract.item_renderer import ItemRenderer
from pandas_profiling.report.presentation.abstract.renderable import Renderable
class Preview(ItemRenderer):
def __init__(
self,
top: Renderable,
bottom: Union[Renderable, None] = None,
ignore: bool = False,
**kwargs
):
super().__init__(
"variable", {"top": top, "bottom": bottom, "ignore": ignore}, **kwargs
)
def __str__(self):
text = "Variabele\n"
text += "- top: {}".format(str(self.content["top"]).replace("\n", "\n\t"))
text += "- bottom: {}".format(str(self.content["bottom"]).replace("\n", "\n\t"))
return text
def __repr__(self):
return "Preview"
def render(self) -> Any:
raise NotImplementedError()
@classmethod
def convert_to_class(cls, obj, flv):
obj.__class__ = cls
if "top" in obj.content:
flv(obj.content["top"])
if "bottom" in obj.content:
flv(obj.content["bottom"])
Classes
class Preview (top, bottom=None, ignore=False, **kwargs)
-
Helper class that provides a standard way to create an ABC using inheritance.
Expand source code
class Preview(ItemRenderer): def __init__( self, top: Renderable, bottom: Union[Renderable, None] = None, ignore: bool = False, **kwargs ): super().__init__( "variable", {"top": top, "bottom": bottom, "ignore": ignore}, **kwargs ) def __str__(self): text = "Variabele\n" text += "- top: {}".format(str(self.content["top"]).replace("\n", "\n\t")) text += "- bottom: {}".format(str(self.content["bottom"]).replace("\n", "\n\t")) return text def __repr__(self): return "Preview" def render(self) -> Any: raise NotImplementedError() @classmethod def convert_to_class(cls, obj, flv): obj.__class__ = cls if "top" in obj.content: flv(obj.content["top"]) if "bottom" in obj.content: flv(obj.content["bottom"])
Ancestors
- ItemRenderer
- Renderable
- abc.ABC
Subclasses
Static methods
def convert_to_class(obj, flv)
-
Expand source code
@classmethod def convert_to_class(cls, obj, flv): obj.__class__ = cls if "top" in obj.content: flv(obj.content["top"]) if "bottom" in obj.content: flv(obj.content["bottom"])
Methods
def render(self)
-
Expand source code
def render(self) -> Any: raise NotImplementedError()