I have the following code snippet in Matlab and want to port it to Python.
for i=1:runs;
tic;
datmat=importdata('data.txt',' ');
Limits_Area=[1,261,522,784,1045,1305,1565,1827,2088,2349,2610,2871,3131,3158];
for k=1:2000;
for j=1:13;
Year_Data=datmat.data(Limits_Area(j):Limits_Area(j+1)-1,4:37);
Min_Year=min(Year_Data);
Max_Year=max(Year_Data);
Mean_Year=mean(Year_Data);
GainLoss_Year=100-(Year_Data(1,:)+0.00000001)./(Year_Data(end,:)+0.00000001)*100;
end;
end;
I am having a really hard time with the
Year_Data=datmat.data(Limits_Area(j):Limits_Area(j+1)-1,4:37);
part.... Any directions?
Thank you
data.txt, and provide some explanation of what you're trying to accomplish, for those of us who know python but aren't fluid in matlab. Can you show us what you tried and how that failed? Additionally, there seems to be a bug in your code in the sense that the outer loop runs the inner loop 2000 times in exactly the same way. Why?