How to remove rows with 0 values from an indexed series in DolphinDB?

19 Views Asked by At

I have a series indexed by date:

s = indexedSeries(2011.12.30..2012.01.01, [0, 60, 0])

I want to remove all rows with 0 values from the series. How should I script this in DolphinDB?

1

There are 1 best solutions below

0
Muhammed Fouzan On
s = indexedSeries(2011.12.30..2012.01.01, [0, 60, 0])

To remove all rows with 0 values try this.

s = select * from s where value != 0

Or:

s = s[s != 0]

You can also use filter function to achieve the same result.

s = filter(s, s != 0)

Hope it helps