diff --git a/tablib/core.py b/tablib/core.py index 4f86b41..26923ea 100644 --- a/tablib/core.py +++ b/tablib/core.py @@ -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 diff --git a/test_tablib.py b/test_tablib.py index e9ef5af..40e83ce 100755 --- a/test_tablib.py +++ b/test_tablib.py @@ -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."""