kuk / log-progress

https://habr.com/ru/post/276725/
MIT License
564 stars 60 forks source link

How does one install this? #7

Open thwee-alchemist opened 6 years ago

thwee-alchemist commented 6 years ago

Hi. I am relatively new to jupyter/ipython, and this looks just like what I need in order to not get bored and turn off the calculation in themiddle. I was wondering if you could write a quick installation guide.

danmoore83 commented 6 years ago

Hi, I just started using this and it is fantastic.

@thwee-alchemist this is what i did, only took about 30 seconds to get up and running.

  1. paste the function into a cell in a jupyter notebook.
  2. replace your existing for loop, with a new one calling the function:

for index in range(100): becomes: for index in log_progress(range(100), every=1):

can be used with a dataframe, and you can pass through the size of the object too

for index, row in df.iterrows(): becomes: for index, row in log_progress(df.iterrows(), every=1, size=len(df)):