The variable mean_data is a nested list, in Python accessing a nested list cannot be done by multi-dimensional slicing, i.e.: mean_data[1,2], instead one would write mean_data[1][2].
This is becausemean_data[2] is a list. Further indexing is done recursively – since mean_data[2] is a list, mean_data[2][0] is the first index of that list.
Additionally, mean_data[:][0] does not work because mean_data[:] returns mean_data.
The solution is to replace the array ,or import the original data, as follows:
mean_data = np.array(mean_data)
numpy arrays (like MATLAB arrays and unlike nested lists) support multi-dimensional slicing with tuples.
You probably do not need to be making lists and appending them to make your array. You can likely just do it all at once, which is faster since you can use numpy to do your loops instead of doing them yourself in pure python.
To answer your question, as others have said, you cannot access a nested list with two indices like you did. You can if you convert mean_data to an array before not after you try to slice it:
R = np.array(mean_data)[:,0]
instead of
R = np.array(mean_data[:,0])
But, assuming mean_data has a shape nx3, instead of
R = np.array(mean_data)[:,0]
P = np.array(mean_data)[:,1]
Z = np.array(mean_data)[:,2]
You can simply do
A = np.array(mean_data).mean(axis=0)
which averages over the 0th axis and returns a length-n array
But to my original point, I will make up some data to try to illustrate how you can do this without building any lists one item at a time: