Select() by multiple range?

Hi, I’m quite newbie to holoviews and would like to select Dataset rows by multiple ranges

For example, according to Indexing and Selection documentation , I can do

ds = hv.Dataset(defects)  
selected_ds =, 0.5))

to select rows whose ‘DSIZE’ value is in (0~0.5) range. Now how can I select them by multiple ranges? (for example, (0, 0.5) and (0.7, 0.8)… .etc)

Any hint or advice will be appreciated.

I’m not sure with select it’s possible to specify multiple ranges but @philippjfr will correct me.
personnally I’ll use something like this:

ds[((ds["x"]>=0.1) & (ds["x"]<=0.3)) | ((ds["x"]>=0.3) & (ds["x"]<=0.5))]

It’s less elegant but it should work

1 Like