go-gota / gota

Gota: DataFrames and data wrangling in Go (Golang)
Other
2.97k stars 276 forks source link

In the series.Slice function, the k value should be allowed to be equal to s.len() #214

Open l-grebe opened 12 months ago

l-grebe commented 12 months ago

i see the code is:

    if j > k || j < 0 || k >= s.Len() {
        empty := s.Empty()
        empty.Err = fmt.Errorf("slice index out of bounds")
        return empty
    }

but maybe the following is right:

    if j > k || j < 0 || k > s.Len() {
        empty := s.Empty()
        empty.Err = fmt.Errorf("slice index out of bounds")
        return empty
    }