Closed
Description
Usecase - I have a Styler
subclass with a new template that I want to pass some arbitrary stuff into - which currently there isn't a great way to do (right now I'm overriding and re-implementing .render()
).
Open to suggestions on the api, but I was thinking of adding template_args
argument that would be passed to the template.
from pandas.formats.style import Styler
from jinja2 import Template
class MyStyler(Styler):
template = Template("""
.... omitted
{{ my_value_1 }}
""")
MyStyler(df, template_args={'my_value_1': '...'}).render()
xref #11610 (master tracker)
pandas 0.19.2