Change stacking method names.

This commit is contained in:
Kenneth Reitz
2010-11-17 20:01:31 -05:00
parent d992ece86a
commit a2990d5852
2 changed files with 8 additions and 7 deletions
+5 -5
View File
@@ -547,8 +547,8 @@ class Dataset(object):
_dset.append(row=row_data)
return _dset
def row_stack(self, other):
def stack_rows(self, other):
"""Stack two :class:`Dataset` instances together by
joining them at the row level, and return a new
@@ -562,16 +562,16 @@ class Dataset(object):
# Copy the source data
_dset = copy(self)
rows_to_stack = [row for row in _dset._data]
other_rows = [row for row in other._data]
rows_to_stack.extend(other_rows)
_dset._data = rows_to_stack
return _dset
def column_stack(self, other):
def stack_columns(self, other):
"""Stack two :class:`Dataset` instances together by
joining at the column level, and return a new
+3 -2
View File
@@ -374,7 +374,7 @@ class TablibTestCase(unittest.TestCase):
for row in self.founders:
to_join.append(row=row)
row_stacked = self.founders.row_stack(to_join)
row_stacked = self.founders.stack_rows(to_join)
for column in row_stacked.headers:
@@ -391,7 +391,7 @@ class TablibTestCase(unittest.TestCase):
for row in self.founders:
to_join.append(row=row)
column_stacked = self.founders.column_stack(to_join)
column_stacked = self.founders.stack_columns(to_join)
for index, row in enumerate(column_stacked):
@@ -402,6 +402,7 @@ class TablibTestCase(unittest.TestCase):
self.assertEqual(column_stacked[0],
("John", "Adams", 90, "John", "Adams", 90))
def test_wipe(self):
"""Purge a dataset."""