Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If the matrix was created using a pandas DataFrame, the columns can be accessed using their names with the following syntax:

df['column_name']

If the matrix was created using a numpy array, the columns can be accessed by indexing the array with the column number, like this:

arr[:, column_number]

Alternatively, the numpy array can be converted into a pandas DataFrame and the columns can be accessed as described above.