I have a dataframe below. After selecting a list of values that 'Status'=0, I would like to select the first values in this list. How can I do that?
Here is my code but it has an error. In this example, the output must be 6
import pandas as pd
import numpy as np
data =pd.DataFrame({
'TruckName':[1,2,3,4,5,6],
'Status':[1,1,1,1,1,0],
'ArrivalTime':[1,2,3,4,5,6],
})
data
a=data.loc[(data['Status']==0),'ArrivalTime'][1]