Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def dropSmall(df):
- list = []
- for i in df.columns: #b, c, z ..
- if i != 'valeur' and i!='unite':
- list.append(i)
- # iterating on rows
- for j in range(df.groupby(list).sum().shape[0]):
- myMax = df.groupby(list).sum().iloc[:, 0].max() / 30
- myJ = df.groupby(list).sum().iloc[:, 0][j]
- myDf = df.groupby(list).sum().iloc[:, 0]
- if myJ <= myMax:
- df = df[myDf['value']>= myMax]
- name b c z l sL value unit
- 3099 Myindicator 1 1 3 NA NA 129.74 kg
- 3100 1 44929.74 kg
- 3101 2 5174.74 kg
- 3110 3 1 3 1 NA 2497.66 kg
- 3156 2 NA 29.43 kg
- 3222 3 NA 304.81 kg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement