Skip to content

Commit

Permalink
Use 0.0 not None as value to transform lambda for new vars
Browse files Browse the repository at this point in the history
  • Loading branch information
SamStudio8 committed Aug 26, 2014
1 parent a4e768c commit b7f4b96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions frontier/frame.py
Expand Up @@ -96,7 +96,7 @@ def transform(self, transformation_dict, add_unknown=False):

label_index = self.frontier_label_index[key]

value = None
value = 0.0
if not new_label:
value = self[:, label_index]
try:
Expand All @@ -110,7 +110,7 @@ def transform(self, transformation_dict, add_unknown=False):
# scalars or length-1 arrays rather than lists.
try:
for i in range(0, np.shape(self)[0]):
value = None
value = 0.0
if not new_label:
value = self[i, label_index]
transformed_self[i, label_index] = transformation_dict[key](value, self, i)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_frame.py
Expand Up @@ -216,7 +216,7 @@ def test_transform_new_label(self):
for j, col in enumerate(transformed_frame[i]):
if j in transform_map:
num_tests += 1
self.assertEquals(transform_map[j](None, frame, i),
self.assertEquals(transform_map[j](0.0, frame, i),
transformed_frame[i, j])
else:
# Check nothing was transformed if it shouldn't have been
Expand Down

0 comments on commit b7f4b96

Please sign in to comment.