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.
Asked: 2022-06-05 11:00:00 +0000
Seen: 8 times
Last updated: May 05 '21