'How to observe the end of the series? [closed]
The problem is that, I don't know how to observe the end of the series. What i mean:
variable = 1
variable = 2
variable = 3
(...)
variable = 14
This "variable" grows to a random number (for example: 14) and then suddenly drops to 0
variable = 0
The biggest problem is that I don't know at what number the "drop" will occur. How to detect this kind of behavior? (I want to save the number where it occurred, in this case it is "14") Has anyone ever had a similar problem to solve?
Sample code:
series = 0
i=1
while i==1:
variable = 1 (web scraped data e.g "1")
if variable ==1:
series = series + 1
else:
series = 0
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
