You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encountered this problem on pyBN/pyBN/classes/factor.py, method reduce_factor
` 585 """
586 exp_len = len(self.cpt)/float(self.card[rv])
--> 587 new_cpt = np.zeros((exp_len,))
588
589 val_idx = self.bn.F[rv]['values'].index(val)
TypeError: 'float' object cannot be interpreted as an index`
In line 587, the exp_len will be type float and the newer version of numpy does not accept it.
From numpy release note:
DeprecationWarning to error
Indexing with floats raises IndexError, e.g., a[0, 0.0].
Indexing with non-integer array_like raises IndexError, e.g., a['1', '2']
Indexing with multiple ellipsis raises IndexError, e.g., a[..., ...].
Non-integers used as index values raise TypeError, e.g., in reshape, take, and specifying reduce axis.
I reinstall the numpy==1.11.3 and that fixed the problem. But I suggest that the type should be cast to int, and there might be other places that has the same problem, too.
The text was updated successfully, but these errors were encountered:
Encountered this problem on
pyBN/pyBN/classes/factor.py
, methodreduce_factor
` 585 """
586 exp_len = len(self.cpt)/float(self.card[rv])
--> 587 new_cpt = np.zeros((exp_len,))
588
589 val_idx = self.bn.F[rv]['values'].index(val)
TypeError: 'float' object cannot be interpreted as an index`
In line 587, the exp_len will be type float and the newer version of numpy does not accept it.
From numpy release note:
I reinstall the numpy==1.11.3 and that fixed the problem. But I suggest that the type should be cast to int, and there might be other places that has the same problem, too.
The text was updated successfully, but these errors were encountered: