Created
March 4, 2017 10:06
-
-
Save smhr/5865073716ec4a4c2cbcdd76ace14360 to your computer and use it in GitHub Desktop.
Read in a loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileList = ['system.dat','system.dat_2.5_0.3','system.dat_2_0.3','system.dat_1.1_0.3', | |
'system.dat_0.85_0.3','system.dat_0.75_0.3','system.dat_2_0.1'] | |
for fileName in fileList: | |
sDateFile = 'myFiles/' + fileName ## File name to read | |
## Read needed data | |
tMc, Time, Mass, Rh, Rhl, Rt, Ntot, Rc, error = np.loadtxt( | |
sDateFile, unpack=True, usecols = (8, 1, 2, 16, 17, 20, 45, 13, 6)) | |
## Plot data | |
plt.plot(Time, Ntot, linewidth = 2, label = fileName ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment