Skip to content

Instantly share code, notes, and snippets.

@gaulinmp
Created May 25, 2016 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gaulinmp/72cc62a2e3ec9055a773078996cf48b9 to your computer and use it in GitHub Desktop.
Save gaulinmp/72cc62a2e3ec9055a773078996cf48b9 to your computer and use it in GitHub Desktop.
Ipython Progress
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