Search return empty result in python

I have this data frame:


id hint
29c45630-7d41-11e9-8ea2-9f2bfe5760ab None
61afc910-3918-11ea-b078-93fcef773138 Yes

and I want to find the first row that has this id = 29c45630-7d41-11e9-8ea2-9f2bfe5760ab

when I run this code:

df[df['id'] == '29c45630-7d41-11e9-8ea2-9f2bfe5760ab']

return empty!!! and the type of this id is "object"

but I really have this id!!

how can I find it?

>Solution :

You code didn’t work because you have UUIDs, not strings, you first need to convert to string:



                                     id  hint
0  29c45630-7d41-11e9-8ea2-9f2bfe5760ab  None

Leave a Reply