Created
May 25, 2016 00:34
-
-
Save gaulinmp/72cc62a2e3ec9055a773078996cf48b9 to your computer and use it in GitHub Desktop.
Ipython Progress
This file contains hidden or 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