Closed frreiss closed 3 years ago
@frreiss I couldn't reproduce. The output I get is a TensorArray and that's what it should be right? There is also a similar test for this already..
In [7]: df = pd.DataFrame({
...: "a": ["foo", "bar"],
...: "b": tp.TensorArray(np.array([[1, 2], [3, 4]]))
...: })
...: result = df.groupby("a").aggregate({"b": "sum"})
...: result["b"]
Out[7]:
a
bar [3 4]
foo [1 2]
Name: b, dtype: TensorDtype
I wonder if it had something to do with some recent changes, would you mind trying it again?
Tried again. The bug is still there. One note though: The last line of the repro script should read:
print(repr(result["b"].array))
(calling __repr__
instead of __str__
to get output that lists the dtype of the array).
Ok, I'll take another look
Oh yeah, I can reproduce now. I should have looked at it closer. Thanks for note, fixing it now.
sum
aggregates applied inside agroupby
operation produce a TensorArray where the backing array is an array of arrays instead of a single n-dimensional array.Code to reproduce:
Output:
Expected output: