Skip to content

Commit

Permalink
Merge pull request #21 from vene/py3
Browse files Browse the repository at this point in the history
FIX py3 compat in transmatrix
  • Loading branch information
larsmans committed Feb 16, 2016
2 parents b85c56e + 1493d32 commit 32d4bfa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion seqlearn/_utils/transmatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import numpy as np
from scipy.sparse import csr_matrix
from sklearn.externals import six


def make_trans_matrix(y, n_classes, dtype=np.float64):
Expand All @@ -14,7 +15,7 @@ def make_trans_matrix(y, n_classes, dtype=np.float64):
"""
indices = np.empty(len(y), dtype=np.int32)

for i in xrange(len(y) - 1):
for i in six.moves.xrange(len(y) - 1):
indices[i] = y[i] * i + y[i + 1]

indptr = np.arange(len(y) + 1)
Expand Down

0 comments on commit 32d4bfa

Please sign in to comment.