Yes I agree with @Hoxbro, @dharhas in your snippet there’s nothing that links the dataframe Parameter to its Tabulator widgets. The code is just rendering the dataframe when view is called.
There’s also another small issue with this line @param.depends('stats'). stats isn’t a Parameter, it’s just a regular Python instance attribute, so you can’t depend on it. Param should actually raises an error in this case (this is a small regression after some big improvement done by Philipp on handling dependencies of subparameters, there’s an open issue).
Here’s another approach:
import param
import pandas as pd
import panel as pn
pn.extension('tabulator')
class Example(param.Parameterized):
stats = param.DataFrame()
dataframe = param.DataFrame(pd._testing.makeDataFrame())
@param.depends('dataframe', watch=True, on_init=True)
def _update_data(self):
self.stats = self.dataframe.describe()
def view(self):
return pn.Param(self.param, widgets=dict(dataframe=pn.widgets.Tabulator))
e = Example()
e.view()