I have a sample data set:
ID sequence
H100 ATTCCT
H231 CTGGGA
H2002 CCCCCCA
I simply want to add a ">" in front of each ID:
ID sequence
>H100 ATTCCT
>H231 CTGGGA
>H2002 CCCCCCA
From this post Append string to the start of each value in a said column of a pandas dataframe (elegantly) I got the code :
df["ID"] = '>' + df["ID"].astype(str)
However, this warning message came up:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
so I tried:
df.loc[: , "ID"] = '>'
The same error message came up
How should i correct it this?
thanks