I have a data made of 20 rows and 2500 columns. Each column is a unique product and rows are time series, results of measurements. Therefore each product is measured 20 times and there are 2500 products.
My data is defined as DataFrame
and I want to write down the number of the row (index) where a specific condition (such as: x> 3
) is met for the first time, for all columns(products, so that I will have an array in the end.
I tried using loops and iterrow but failed at executing.
P.S: I used idxmax()
in order to get the row id of max value but this time I want to get the index of the cell where a condition is met for the first time and then break.