alive-progress icon indicating copy to clipboard operation
alive-progress copied to clipboard

Usage with np.arange()

Open zooplibob opened this issue 1 year ago • 2 comments

I have some code doing a sweep using np.arrange:

for variable in np.arange(10, 20, 0.1): ...

I can use manual mode can calculate the percentage, but how can I have it display the actual value of variable next to the bar (rather than just percent)?

zooplibob avatar Feb 21 '24 16:02 zooplibob

Check out the Displaying messages section of the README - bar.text might be what you're looking for

TheTechRobo avatar Feb 21 '24 16:02 TheTechRobo

You have two ways. One is like you and @TheTechRobo have said: use manual mode to directly calculate the percentage, and bar.text to display it on the bar. Another is to just use the variable range as the total, which would automatically calculate the percentage for you. You could also show it the same way.

range = (20 - 10) / .1 = 100 steps

rsalmei avatar Feb 21 '24 18:02 rsalmei