I'm currently running a series of experiments, which I need to run multiple times to generate decent error bars. Each experiment outputs a file which has various info like mean/std/throughput/latency/nth percentile etc.
I then plot each of these values, but to get a more sensible result, I need to take the mean of all of these files for each cell, and plot that with the standard deviation obtained as error bars.
The code I have so far does not however work:
data_1 = np.loadtxt(fold + "/" + "clients_1.txt")
data_2 = np.loadtxt(fold + "/" + "clients_2.txt")
data_3 = np.loadtxt(fold + "/" + "clients_3.txt")
data = [data_1,data_2,data_3]
d_avg = sum(data) / float(len(data))
err = np.std(d_avg)
plt.plot(d_avg[:,19],d_avg[:,7], label='Test Plot', yerr = err[:,7] )
The error I get is this:
IndexError: 0-d arrays can only use a single () or a list of newaxes (and a single ...) as an index
Slightly confused as to what the issue is. The d_agv
file prints ok.
All the client files have the same number of column rows, and each cell in one file corresponds to the same cell in the other file (potentially with different values obviously)
The format of each row in each file is :
1 1 50 1 1 0 100 11.30000 9.00000 50.00000 32.09000 5.66480 9.00000 9.00000 10.00000 11.00000 12.00000 13.55000 32.85000 39.47368
and there are multiple such rows.