[Solved] Subsetting the data frame and applying cumulative operation on multiple columns
[ad_1] Hopefully I got it this time: subdf = df.iloc[3:, 1:4] df[‘flag’] = 1 if subdf.values.sum()/subdf.size >= 0.1 else 0 output: unit A B C row_num flag 0 ABC 1 1 1 7 1 1 DEF 1 1 1 6 1 2 GEH 1 1 1 5 1 3 IJK 0 1 0 4 1 … Read more