Skip to content

Commit

Permalink
Use TypeError as e over TypeError, e syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
SamStudio8 committed Aug 26, 2014
1 parent 0bcf393 commit eef351d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontier/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ def transform(self, transformation_dict):
# self[:,self.frontier_label_index[key]] = transformation_dict[key](self[:,self.frontier_label_index[key]])
transformed_self[:,self.frontier_label_index[key]] = transformation_dict[key](self[:,self.frontier_label_index[key]])

except TypeError, e:
except TypeError as e:
# Try to apply the transformation to each applicable element
# to support use of `math` module functions which require
# scalars or length-1 arrays rather than lists.
try:
label_index = self.frontier_label_index[key]
for i in range(0, np.shape(self)[0]):
transformed_self[i, label_index] = transformation_dict[key](self[i, label_index])
except TypeError, e:
except TypeError as e:
raise Exception("Transformation provided for label %s is not a callable." % key)
return DataFrame(transformed_self, self.frontier_labels)

0 comments on commit eef351d

Please sign in to comment.