Skip to content

DOC/CLN: cookbook addition, minor cleaning in internals.py #3079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2013
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
6 changes: 6 additions & 0 deletions doc/source/cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ Grouping
`Create multiple aggregated columns
<http://stackoverflow.com/questions/14897100/create-multiple-columns-in-pandas-aggregation-function>`__

Splitting
~~~~~~~~~

`Splitting a frame
<http://stackoverflow.com/questions/13353233/best-way-to-split-a-dataframe-given-an-edge/15449992#15449992>`__

Timeseries
----------

Expand Down
8 changes: 0 additions & 8 deletions pandas/core/internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,14 +795,6 @@ def __nonzero__(self):
def ndim(self):
return len(self.axes)

def is_mixed_dtype(self):
counts = set()
for block in self.blocks:
counts.add(block.dtype)
if len(counts) > 1:
return True
return False

def set_axis(self, axis, value):
cur_axis = self.axes[axis]
value = _ensure_index(value)
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/test_internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ def test_attrs(self):
self.assertEquals(len(self.mgr), len(self.mgr.items))

def test_is_mixed_dtype(self):
self.assert_(self.mgr.is_mixed_dtype())
self.assert_(self.mgr.is_mixed_type)

mgr = create_blockmanager([get_bool_ex(['a']), get_bool_ex(['b'])])
self.assert_(not mgr.is_mixed_dtype())
self.assert_(not mgr.is_mixed_type)

def test_is_indexed_like(self):
self.assert_(self.mgr._is_indexed_like(self.mgr))
Expand Down