How to quickly check if a value exists in pandas DataFrame index?
Another way could be.
a=time.time()
if value in set(dataframe.index)
b=time.time()
timetaken=b-a
When I update the dataframe, I should check if the value exists in the dataframe index, but I want to know which way is faster, thanks!

1. if value in set(dataframe.index)
2. if value in dataframe.index