lundi 11 juillet 2022

Matlab to Python conversion of randi()

I have this in matlab: "

    num = 5; 
    vetor_G = zeros(1,num);
    rand('seed',100);
    for i = 0:1:2
        vetor_G = randi([0,1], [1,num]);
        fprintf('number %d: ',i);
        fprintf('[');
        fprintf(' %d', vetor_G);
        fprintf(']');
        fprintf('\n')
    end

"

I need and equivalent por randi() in python, because randit() in python is not resulting in the same distributuion of random number




Aucun commentaire:

Enregistrer un commentaire