How can this MATLAB code be translated to Python?
For example with random files:
FileA = rand([10,2]);
FileB = randperm(10);
for i=1:10
fileC(FileB(i),1)=FileA(i,1); %for the x
fileC(FileB(i),2)=FileA(i,2); %for the y
end
How can this MATLAB code be translated to Python?
For example with random files:
FileA = rand([10,2]);
FileB = randperm(10);
for i=1:10
fileC(FileB(i),1)=FileA(i,1); %for the x
fileC(FileB(i),2)=FileA(i,2); %for the y
end
if you don't want to depend of numpy and you are not dealing with large arrays/performance is not an issue, try this: