oTree Forum >

int saved as bytes

#1 by Andrea

Hi everyone. Another question. I get the following error:

TypeError: '<=' not supported between instances of 'int' and 'bytes'

In my code (constants section) I have the following lines:

num_matches = 10 # set to high number (e.g., 50) if time_limit == True
    match_duration = np.random.geometric(p=(1-delta), size=num_matches)  # the first argument here is the probability the match ends after each round (i.e., 1 - \delta); the second argument is the number of matches. For documentation, see: https://docs.scipy.org/doc/numpy-1.14.1/reference/generated/numpy.random.geometric.html
    num_rounds = np.sum(match_duration)
    last_rounds = np.cumsum(match_duration)
    last_round = last_rounds[-1]
    first_rounds = [1]
    for k in range(1, len(match_duration)):
        first_rounds.append(int(last_rounds[k - 1] + 1))

and I read in other posts that numpy (np) sometimes generates this. However writing for example  num_rounds = int(np.sum(match_duration)) does not work. How should I solve it?


Many thanks in advance
Andrea

Write a reply

Set forum username