Entering edit mode
2.4 years ago
pramirez
▴
10
I have a list of annotated protein sequences with their corresponding IDs. I am trying to create a function that detects consecutive duplicate entries in the first column (protein ID) and returns false or true. I tried this:
df = pd.read_csv('taxonomy.tsv', sep='\t', decimal='.')
value = df.iloc[:, 1].diff().lt(0)
print (value)
I obtain the following error:
TypeError: unsupported operand type(s) for -: 'str' and 'str'
Do you know how can I fix it?
Thank you.
Hi! Thanks! I tried your method and obtained the following error: TypeError: '(slice(None, None, None), 1)' is an invalid key
sorry, I forgot the iloc.