Let's say I want to get the first row of a dataframe where a certain column has negative value:
import pandas as pd
df = pd.DataFrame(columns=['c'],data=[[2.4,2.3,-1.0]])
index = df.loc[df['c'] < 0].index[0]
Now this works but in case I have a dataframe with millions of rows, I don't want to iterate over all of them to get the index. Is there a way to get the index without having to loop over each row? (Would be slow)