I have a matlab code that I'm trying to translate in python. I'm new on python but I have been able to answer a lot of questions googling a little bit. But now, I'm trying to figure out the following: I have a for loop when I apply different things on each column, but you don't know the number of columns. For example. In matlab, nothing easier than this:
for n = 1:size(x,2); y(n) = mean(x(:,n)); end
But I have no idea how to do it on python when, for example, the number of columns is 1, because I can't do x[:,1] in python. Any idea?
Thanx