gl.aggregate.CONCAT - implicit conversion to double

User 2032 | 8/26/2015, 11:29:27 AM

Given a sframe with columns

groupby_key - int agg1 - int agg2 - list[int]

and running

gb = sframe.groupby('groupby_key', {'agg': gl.aggregate.CONCAT('agg1', 'agg2')})

gb[0] yields:

{
   'groupby_key': 470648,
    'agg': {
       1440579275.0: array('d', [26305711.0, 10.0]),
       1440579638.0: array('d', [28517040.0, 10.0]),
       1440579765.0: array('d', [27429668.0, 16.0]),
       1440583693.0: array('d', [28541835.0, 10.0])
   }
}

Which means that there is an implicit conversion in place that could introduce hard to trace errors in the future (for example after converting to string).

Comments

User 954 | 8/26/2015, 9:14:12 PM

Hi, I can regenerate the problem with the following code snippet: <pre> sa = gl.SArray([[1,2],[2,3]]) sf = gl.SFrame({'a':[1,2],'b':[3,4],'c':sa}) gb = sf.groupby('a', {'agg': gl.aggregate.CONCAT('b', 'c')}) </pre> This is a known issue and the fix is on the roadmap. As a workaround you can explicitly specify the SArray type in gl.SArray(): <pre> sa = gl.SArray([[1,2],[2,3]],dtype=list) </pre>

I hope it helps.