Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def apply(self, func, **kwargs):
""" apply the function to my values; return a block if we are not one """
result = func(self.values)
if not isinstance(result, Block):
result = make_block(values=result, placement=self.mgr_locs,)
result = make_block(values=_block_shape(result), placement=self.mgr_locs,)

return result

Expand Down
12 changes: 12 additions & 0 deletions pandas/tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,18 @@ def test_repr(self):
self.assertEqual(exp,a.__unicode__())


def test_info(self):

# make sure it works
n = 2500
df = DataFrame({ 'int64' : np.random.randint(100,size=n) })
df['category'] = Series(np.array(list('abcdefghij')).take(np.random.randint(0,10,size=n))).astype('category')
df.isnull()
df.info()

df2 = df[df['category']=='d']
df2.info()

def test_groupby_sort(self):

# http://stackoverflow.com/questions/23814368/sorting-pandas-categorical-labels-after-groupby
Expand Down