# Using mean aggregator with frequency limit on rasterize

**URL:** <https://discourse.holoviz.org/t/using-mean-aggregator-with-frequency-limit-on-rasterize/6234>\
**Category:** Datashader\
**Created:** [October 19, 2023, 11:44am UTC](https://discourse.holoviz.org/t/using-mean-aggregator-with-frequency-limit-on-rasterize/6234 "2023-10-19T11:44:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgross](https://discourse.holoviz.org/letter_avatar_proxy/v4/letter/m/f475e1/32.png) [@mgross](https://discourse.holoviz.org/u/mgross)\
**Post date:** [October 19, 2023, 11:44am UTC](https://discourse.holoviz.org/t/using-mean-aggregator-with-frequency-limit-on-rasterize/6234/1 "2023-10-19T11:44:37Z")

</div>

Hello,  
Is it possible to tell rasterize to only calculate an aggregator function (ex: mean) when the count behind the pixel is above a certain limit? I need the result to be dynamic with other graphes (using link selection)

Today, I’m doing the following:

```auto
        import bokeh,datashader as ds
        from holoviews.operation.datashader import aggregate, spread
        from holoviews.operation import datashader as hd
        ls3 = hv.link_selections.instance()

        shaded = spread(hd.rasterize(hv.Points(df, ['x','y']),
                                     aggregator=ds.mean('speed'),
                                     dynamic=True
                                    ))
        tracks = tile.redim.range(x=lon_range, y=lat_range)*ls3(shaded.opts(colorbar=True,
                                                                        cmap='rainbow',
                                                                        cnorm='eq_hist',
                                                                        frame_width =map_width,
                                                                        frame_height=map_height))

```

Thanks  
Matt
