How I can convert this matlab code to python?
Question: I would like to write the following operation from matlab to python(numpy).

repmat(sum(data,2),1,20);


Answer: have a look at [What is the equivalent of MATLAB's repmat in
NumPy](http://stackoverflow.com/questions/1721802/what-is-the-equivalent-of-
matlabs-repmat-in-numpy)

I would propose something like

    
    
    import numpy as np
    np.tile(np.sum(data, axis=1), 1, 20)
    

`axis=1` refers to the dimension along which the sum is taken. as far as I
remember, matlab starts index counting with 1, in python/numpy it starts with
0.

hope this is what you are looking for.

