Skip to content

sort_display=True leads to wrong results in rt.Accum2 #304

@ykallus

Description

@ykallus

Possibly related to #129

import riptable as rt
rt.__version__
ds = rt.Dataset({'a': rt.Cat([0, 1, 0, 1]), 'b': rt.Cat([1, 1, 0, 0]), 'x': rt.arange(4), 'y': rt.arange(4)**2+1})
print('wrong:')
print(rt.Accum2(rt.Cat([ds['a'], ds['b']], sort_display=True), ds['x']).sum(ds['y']))
print('correct, but unsorted:')
print(rt.Accum2(rt.Cat([ds['a'], ds['b']]), ds['x']).sum(ds['y']))
'1.0.58'
wrong:
*a   *b      0   1   2    3   Total
--   -----   -   -   -   --   -----
0    0       1   0   0    0       1
.    1       0   2   0    0       2
1    0       0   0   5    0       5
.    1       0   0   0   10      10
--   -----   -   -   -   --   -----
     Total   1   2   5   10      18
correct, but unsorted:
*a   *b      0   1   2    3   Total
--   -----   -   -   -   --   -----
0    1       1   0   0    0       1
1    1       0   2   0    0       2
0    0       0   0   5    0       5
1    0       0   0   0   10      10
--   -----   -   -   -   --   -----
     Total   1   2   5   10      18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions