Can you provide code that's giving trouble? The operations on columns that you list are among the most basic operations that are supported and optimized in NumPy. Consider looking over the tutorial on NumPy for MATLAB users, which has many examples of accessing rows or columns, performing vectorized operations on them, and modifying them with copies or in-place.
Just to clarify, suppose you have a 2-dimensional NumPy ndarray
or matrix
called a
. Then a[:, 0]
would access the first column just the same as a[0]
or a[0, :]
would access the first row. Any operations that work for rows should work for columns as well, with some caveats for broadcasting rules and certain mathematical operations that depend upon array alignment. You can also use the numpy.transpose(a)
function (which is also exposed with a.T
) to transpose a
making the columns become rows.