Ipython Progress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from IPython.display import display | |
import ipywidgets | |
df = list(range(100)) | |
f = ipywidgets.FloatProgress(min=0, max=len(df)) | |
out = ipywidgets.Output() | |
display(f, out) | |
for i in df: | |
f.value += 1 | |
if not i % 10: | |
out.clear_output() | |
with out: | |
print("We are at {} of {} ({:.0f}%)" | |
.format(i, len(df), 100*i/len(df))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment