Skip to content

Commit

Permalink
Merge 8bcac97 into 7b7f81d
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanhemani committed Jun 7, 2020
2 parents 7b7f81d + 8bcac97 commit f02d689
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

### v0.15.6
* Adds support for NumPy v1.18.0+.

### v0.15.5
* Fixes multiple bugs with the `Table#remove`.

Expand Down
5 changes: 4 additions & 1 deletion datascience/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -2883,7 +2883,10 @@ class Row(tuple):
_table = None # Set by subclasses in Rows

def __getattr__(self, column_label):
return self[self._table.column_index(column_label)]
try:
return self[self._table.column_index(column_label)]
except ValueError: #adding support for NumPy v1.18.0 as per changes in https://github.com/numpy/numpy/pull/14745
raise AttributeError("Attribute ({0}) not found in row.".format(column_label))

def item(self, index_or_label):
"""Return the item at an index or label."""
Expand Down
2 changes: 1 addition & 1 deletion datascience/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.15.5'
__version__ = '0.15.6'
5 changes: 5 additions & 0 deletions tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ def test_basic_rows(table):
t.rows[2],
"Row(letter='c', count=3, points=2)")

def test_row_conversion_to_np_array(table):
t = table
t_subset = t.select("count", "points")
assert_array_equal(np.array(t_subset.row(0)), np.array([9, 1]))

def test_select(table):
t = table
test = t.select('points', 1)
Expand Down

0 comments on commit f02d689

Please sign in to comment.