Skip to content

Commit

Permalink
all set, all pass..
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwelljweinstein committed Oct 3, 2016
1 parent 76dac3a commit 7cd514c
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions datascience/tables.py
Expand Up @@ -1391,11 +1391,10 @@ def with_column(self, label, values):
Traceback (most recent call last):
...
ValueError: The column label must be a string, but a int was given
>>> alphabet.append_column('bad_col', make_array(1))
>>> alphabet.with_column('bad_col', make_array(1))
Traceback (most recent call last):
...
ValueError: Column length mismatch. New column does not have the same
number of rows as table.
ValueError: Column length mismatch. New column does not have the same number of rows as table.
"""
new_table = self.copy()
new_table.append_column(label, values)
Expand Down Expand Up @@ -1454,16 +1453,10 @@ def with_columns(self, *labels_and_values):
Traceback (most recent call last):
...
ValueError: The column label must be a string, but a int was given
>>> players.with_columns(2, make_array('$600,000'))
>>> players.with_columns('salaries', make_array('$600,000'))
Traceback (most recent call last):
...
ValueError: Column length mismatch. New column does not have the same
number of rows as table.
>>> players.with_columns('salaries',
... make_array('$600,000', '$20,000,000'), 'new_column')
AssertionErrorTraceback (most recent call last)
...
AssertionError: Even length sequence required
ValueError: Column length mismatch. New column does not have the same number of rows as table.
"""
if len(labels_and_values) == 1:
labels_and_values = labels_and_values[0]
Expand Down

0 comments on commit 7cd514c

Please sign in to comment.