Sep-16-2024, 08:44 PM
Hi, thanks for your reply!
Time sequence are NOT always consecutive in a segment.
Actually, I should have something like this (simplified here)
df = pd.DataFrame({"time": [-3, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, 3, 4, -2, -1, 0, 1, 2, 3], "deltaF_F": [-0.5, 1, 5, 6, 5, -7, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, 3]})
print(df)
Then I should have a script that creates another column called "cycle', in which I assign number of cycles. Given that I have three 0 in the time column, I should have 3 cycles.
In the column "time", the first negative values before the first 0 and all the positive values after this 0 should be attributed Cycle 1. Cycle 2 starts at the next first encountered negative value (-2), reaches the second 0, and ends at last positive value (4). Same for cycle 3.
Best,
Time sequence are NOT always consecutive in a segment.
Actually, I should have something like this (simplified here)
df = pd.DataFrame({"time": [-3, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, 3, 4, -2, -1, 0, 1, 2, 3], "deltaF_F": [-0.5, 1, 5, 6, 5, -7, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, 3]})
print(df)
Then I should have a script that creates another column called "cycle', in which I assign number of cycles. Given that I have three 0 in the time column, I should have 3 cycles.
In the column "time", the first negative values before the first 0 and all the positive values after this 0 should be attributed Cycle 1. Cycle 2 starts at the next first encountered negative value (-2), reaches the second 0, and ends at last positive value (4). Same for cycle 3.
Best,