I have multiple data set with names dat01, dat02,... so on! . I want to load these datasets using for loop or any other trick. Afterwards, I want to plot these datasets in a single plot. Right now I'm doing something like this
import numpy as np
data1=np.loadtxt("dat01.dat")
xData1, yData1 = np.hsplit(data1, 2)
x1 = xData1[:,0]
y1 = yData1[:,0]
data2=np.loadtxt("dat01.dat")
xData2, yData2 = np.hsplit(data2, 2)
x2 = xData2[:,0]
y2 = yData2[:,0]
# plotting these datasets
plt.plot(x1, y1)
plt.plot(x2,y2)
This method works but not a smart way. Are there other methods that can be employed to reduce the typing?