mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 23:10:17 +00:00
Change stacking method names.
This commit is contained in:
+5
-5
@@ -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
@@ -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."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user