import scanpy as sc remove_genes_list = ['malat1'] for gene in remove_genes_list: remove_genes = adata.var_names.str.startswith(gene) remove = np.array(remove_genes) keep = np.invert(remove) adata = adata[:,keep]