I have a number of 1500 .txt files in a folder and each file has only one line like this:
24.171683 25.663069 26.996733 27.684257 28.411782 29.253564
The name of files is the combination of numbers and letters such as Animation1000_1_0.txt, Animation1000_10_1.txt, ... Now I need to read all .txt files' content in an array, but based on their order in the original folder. For this I used the following code:
psnr_bitrate=np.vstack([np.loadtxt(path, dtype='float') for path in glob.iglob(r'E:/PSNR_RDCURVE/*.txt')])
but when I checked the psnr_bitrate
array, it does not have the same order as files and I do not know how this code read the files. Do you know what should I read the files in an array with same order as files?