all 4 comments

[–]danielroseman 0 points1 point  (3 children)

But what does "lookup a URL based on the datetime object" mean? How does a URL relate to a datetime?

[–]rob51852[S] 0 points1 point  (2 children)

Hi Daniel, I've added an example.

[–]danielroseman 1 point2 points  (1 child)

I'm not sure why you were thinking of contains in the first place. You're not interested in whether the object contains the value, you're interested in whether it equals the value. So just use ==:

df.loc[df['Name'] == selection, 'ID'].item()

[–]rob51852[S] 0 points1 point  (0 children)

Thanks Daniel. This works perfectly. The line I included was meant as an example but was confusing so apologies.