I have a dataframe called data6, with 6000 rows, and i want to copy to na 2000 rows data frames, called result, only Month columns values when level columns value are 1. How do create a for loop with this rule?
Now:
in: data6 = df1[['level', 'Month']]
print(data6)
out: level Month
0 1.0 101.52
1 2.0 101.52
2 3.0 101.52
3 1.0 111.89
4 2.0 111.89
Expected after the for loop:
in: print(result)
out: level Month
0 1.0 101.52
1 1.0 111.89
2 1.0 112.27
3 1.0 89.57
4 1.0 110.35