Skip to content

Commit a903e97

Browse files
committed
BUG: tests pass now
1 parent 7f2f70c commit a903e97

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pandas/core/groupby.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -323,10 +323,17 @@ def _generator_factory(self):
323323

324324
def _is_indexed_like(obj, other):
325325
if isinstance(obj, Series):
326+
if not isinstance(other, Series):
327+
return False
326328
return obj.index.equals(other.index)
327329
elif isinstance(obj, DataFrame):
330+
if not isinstance(other, DataFrame):
331+
return False
332+
328333
return obj._indexed_same(other)
329334

335+
return False
336+
330337
class Grouping(object):
331338

332339
def __init__(self, index, grouper=None, name=None, level=None):
@@ -780,7 +787,7 @@ def _wrap_applied_output(self, keys, values, not_indexed_same=False):
780787
columns = values[0].index
781788
index = keys
782789
else:
783-
stacked_values = np.vstack(values)
790+
stacked_values = np.vstack(values).T
784791
index = values[0].index
785792
columns = keys
786793

pandas/tests/test_sparse.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def _compare_with_dense(sp):
310310
dense = sp.to_dense()
311311

312312
def _compare(idx):
313-
dense_result = dense.take(idx)
313+
dense_result = dense.take(idx).values
314314
sparse_result = sp.take(idx)
315315
assert_almost_equal(dense_result, sparse_result)
316316

0 commit comments

Comments
 (0)