Hey , we are trying use groupby to do list aggrega...
# daft-dev
y
Hey , we are trying use groupby to do list aggregation essentially we have a column for bbox for our data : [x1,x2,y1,y2] . We want to do groupby and list aggregate using a unique id to get a list of bboxes [[x1,x2,y1,y2],[x1,x2,y1,y2],[x1,x2,y1,y2]] ? however when we use groupby and use list aggregate it raise a list of list not implemented issue.
cc : @jay
j
Seems like we just had not implemented this. Should be a simple fix @Kevin Wang wanna take a quick stab? @yashovardhan chaturvedi could you create an issue? Much appreciated!
y
sure awesome thank you 🙂 I will create an issue.
k
Did you try grouped_df.agg_list(col('bbox'))?
Oh it doesn't work because it's not a string but a list?
y
yes.
k
Maybe you could change the bbox into a string with list.join(',') then agglist then list.join with a different separator but it's very roundabout
y
yes for now that's what we are thinking of doing. But we loose the ability to do operations to derive insights from the bbox's to filter our data before we get it ready to ingest it for training workflows. The same goes for more complex structs.
🙌 1
like point clouds etc .
k
Agreed.. i am also keen on having these and also more list operations on the grouped list of lists
❤️ 2
y
yep we are exploring daft so that we can integrate it with ray datasets 🙂 .
j
😂 that string conversion seems highly unnecessary If you’re looking for a workaround for now as we work on the issue you might be able to use Python code in a
.map_groups
👀 1
The issue shouldn’t be too hard though, maybe will take us a few days
Also very quick heads up @yashovardhan chaturvedi I **think a lot of our image kernels work on bboxes like
[x, y, height, width]
instead of x1/y2/x2/y2. If you’re leveraging those you might want to watch out for that potential gotcha Reason being some of them such as .resize also work on
height, width
, so it makes it much more convenient 😛
👍 1
y
I see will keep in mind 🙂