can I return 0 instead of Nan with DolphinDB kurtosis?

50 views Asked by At

Function kurtosis in DolphinDB returns Nan for data with all zeros. Python returns 0 for such data, is there any way to adjust the two to be consistent?

1

There are 1 answers

0
Polly On

You can make a judgment with DolphinDB’s iif with the script:

x = matrix(0 0 0 0, 1 2 3 4)
iif(sum(x==0) == x.rows(), 0, kurtosis(x))