I am a beginner with Python, and I come from MATLAB. What I need to do is create a loop with years from 2000 to 2016. I have a directory with a lot of files, whose filenames contain these years, like "file_2006". How can I create a loop to open the files for specific years? In MATLAB I would do it like:
for i=2000:2016
year=num2str(i);
filename=['file_' year];
X=cdfread(filename); % and then some operations with X that I read here
end
But is it possible to do it in Python? Thank you!
filename = 'file_{}'.format(2000).