I'm removing some columns from a numpy array using a boolean array. Is it possible to do something similar with a list?
#Set a numpy array of booleans to True if column datatype is "Categorical"
cols_to_remove = np.array([datatype == "Categorical" for datatype in datatypes])
#Make a new array without the "Categorical" columns
cat_data = data[:, -cols_to_remove] # data here is a 2D numpy array
#Trying to do the same for a list - this way doesn't work
cat_datatypes = datatypes[-cols_to_remove] # datatypes here is a 1D list