vaexio / vaex

Out-of-Core hybrid Apache Arrow/NumPy DataFrame for Python, ML, visualization and exploration of big tabular data at a billion rows per second 🚀
https://vaex.io
MIT License
8.23k stars 590 forks source link

Issue when trying to use interactive heatmap (df.widget.heatmap --> NameError: name 'observe' is not defined) #2321

Open meierale opened 1 year ago

meierale commented 1 year ago

I was following your article (https://towardsdatascience.com/vaex-out-of-core-dataframes-for-python-and-fast-visualization-12c102db044a) and tried to reproduce it locally (on an Azure AML compute instance)

Whilst most things work as expected, creating an interactive heatmap fails. I am using the yellow taxi 2015 hdf5 file you provide in your datasets section. Invoking df_yt_2015.widget.heatmap(df_yt_2015.dropoff_longitude, df_yt_2015.dropoff_latitude, shape=400, f='log1p', controls_selection=True) fails with:

File /anaconda/envs/my_env/lib/python3.8/site-packages/vaex/jupyter/widgets.py:517, in ToolsToolbar()
    513 @traitlets.default('template')
    514 def _template(self):
    515     return load_template('vue/tools-toolbar.vue')
--> 517 @observe('z_normalize')
    518 def _observe_normalize(self, change):
    519     self.normalize = bool(self.z_normalize)

NameError: name 'observe' is not defined

I didn't have time to dig further into it.

LukeDickerson19 commented 2 months ago

I've found a fix for this. See here.