I have a dataframe (see after) in which I have two columns containing either a list of patients or an empty list (like that [''] ). I want to remove the empty list
What i have:
| Homozygous_list | heterozygous_list |
|---|---|
| [Patient1,Patient2] | [''] |
| [''] | [Patient1] |
What i want:
| Homozygous_list | heterozygous_list |
|---|---|
| [Patient1,Patient2] | |
| [Patient1] |
I try several thing like :
variants["Homozygous_list"].replace("['']","", regex=True, inplace=True)
or
variants["Homozygous_list"].replace("\[''\]","", regex=True, inplace=True)
or
variants["Homozygous_list"] = variants["Homozygous_list"].replace("['']","", regex=True)
etc but nothing seems to work.