Easy Python Progress Bars with tqdm

Поделиться
HTML-код
  • Опубликовано: 29 янв 2025

Комментарии • 197

  • @OmegaRxNeo
    @OmegaRxNeo 2 года назад +25

    The best explanation about tqdm in the internet. Direct to the point and with easy explanations! Please continue sharing your knowledge. I found your channel looking for data analysis in Python, and really enjoy your content. Cheer's from Brazil!!!!

    • @robmulla
      @robmulla  2 года назад +1

      Thanks so much for the feedback. That really means a lot to me.😊

  • @aleks_shcherbakov
    @aleks_shcherbakov Год назад +1

    Rob, thank you so much for your hard work and contribution to the development of the data analyst community! From Russia with love!

  • @ritvikrastogi4912
    @ritvikrastogi4912 2 года назад +7

    Hi Rob, warm greetings from India
    I got to know about your channel when you did a live stream on Abhishek Thakur's channel
    I've been following you since then and I really like your content, especially how you make it so easy to understand and yet it's still in-depth and cover most of the concepts about that topic
    I just have one little request please make some tutorials on advanced topics as well like Transformers, Auto encoders etc

  • @IntelliTradeBot
    @IntelliTradeBot Год назад

    Thank you, sir.. learning from a Pro is a much better option than reading through the help manual.

  • @mateusbalotin7247
    @mateusbalotin7247 2 года назад +1

    Thanks for the video!! Hope you have a great week.

    • @robmulla
      @robmulla  2 года назад

      Thanks for watching!

  • @daytodatainc
    @daytodatainc Год назад

    Great explanation with practical examples. Thanks!!

  • @ramonbr66
    @ramonbr66 2 года назад +1

    Excelent video! Thank you, Rob.

    • @robmulla
      @robmulla  2 года назад

      Appreciate the kind words. Thanks for watching.

  • @robmulla
    @robmulla  2 года назад +1

    Here is a gist with the code from the tutorial if you would like to try it yourself: gist.github.com/RobMulla/0fe4acf99001d4657df4e73c93cf3218

  • @RafaelCataldo
    @RafaelCataldo 2 года назад +1

    Thanks for the lesson, sir. I have one question. I defined a function and used the tqdm in it. When I call this function from a .py file, the tqdm does not get recognized, even importing as you shown it here. Do you have any clue how to solve this issue? When I define the function in a cell and then I call it, it works! But the functions are too big and, thus, I wanted it to keep on the .py file I'm using to call some functions when need it. Thanks for your time.

    • @robmulla
      @robmulla  2 года назад +1

      Hi. Thanks for the comment. Have you made sure to import tqdm at the top of your .py file? It needs to be imported in the file where it is called. Hope that helps.

    • @RafaelCataldo
      @RafaelCataldo 2 года назад +1

      @@robmulla That was it! Thanks! Now I have a new problem to solve, but little by little I'll get there lol! Thanks again!

    • @robmulla
      @robmulla  2 года назад

      @@RafaelCataldo Glad you figured it out!

  • @prasannakukade300
    @prasannakukade300 2 года назад +1

    Very smooth explanation...

    • @robmulla
      @robmulla  2 года назад

      Thanks! Glad you found it helpful.

  • @aaronjenkins223
    @aaronjenkins223 6 месяцев назад

    Is there a way i can make a progress bar that tracks sub loops? I have a function that loops through Members, and for each member loops through assignments and then writes to a file. Is there a way to have it track every time it writes to the file without having to be in the bottom loop? As it is if i put it on the members it just updates x% after each member and the time remaining is way off because some have a lot more assignments than others.

  • @vivekjoshi3769
    @vivekjoshi3769 Год назад

    Hi
    First of all thank you for sharing this.
    I have some doubt.
    When I use sleep(0.00001) like you under for dogs loop with 50000 iterations, it's taking more than 5 minutes to run but in your case I see it ran under 2 minutes.
    May I know why is it faster in your case but slower in mine?
    I am using VS code for running this.
    I am talking about the part at 02:50
    Please clarify.

  • @ignatiusezeani6816
    @ignatiusezeani6816 Год назад

    Thanks so much for this insightful video.🙏

  • @vydo4210
    @vydo4210 2 года назад +1

    This tutorial is very good.

  • @AnastasiaZvychaynaya
    @AnastasiaZvychaynaya Год назад +2

    Hello! I don't know why but I have an error:
    out = fake_df.groupby('dog').progress_apply(lambda row: int(row['smell'])**2)
    my bar: 67%|██████▋ | 2/3 [00:00

    • @robmulla
      @robmulla  Год назад

      Sorry I don’t think I can fully debug this for you. But maybe try setting axis=1 in the apply?

    • @AnastasiaZvychaynaya
      @AnastasiaZvychaynaya Год назад +1

      @@robmulla Setting axis=1 doesn't help, the problem was that numpy.random.randint returns a string in my case (I really don't know why), whereas from documentation it has to be int. Interesting, but this is how a local program is executed (I used to do it in Colab). I simply converted 'smell' data to int. Anyway, thanks for you quick reply!

  • @7686Jin
    @7686Jin 6 месяцев назад

    Great tutorial! Btw how do I update the progress bar if im using multiprocessing?

  • @akashnevtia8419
    @akashnevtia8419 Месяц назад

    Can you show some examples where in place of logging to console it’s logging in production setup and for example let’s use Loki as scrapper. So now we need the logger setup but because of buffering it only print when entire thing is done. Let me know if you have a solution for this

  • @GeoffryGifari
    @GeoffryGifari 10 месяцев назад

    Can tqdm be initialized _inside_ a loop?
    so without specifying the iterable's length first

  • @irfanshaikh262
    @irfanshaikh262 Год назад +1

    @Rob Thanks a tonn for this video. Its really helpful.

    • @robmulla
      @robmulla  Год назад

      Glad it was helpful for you. Like & share with all your friends!

  • @tutosolve
    @tutosolve 2 года назад +1

    Nice video . From Vietnam

    • @robmulla
      @robmulla  2 года назад

      Thanks for watching!

  • @nerassurdo
    @nerassurdo 2 года назад +2

    Can you please show an example of how you would implement this for scikit-learn when doing a RandomForest or XGBoost model and you're hyper-parameter tuning?

    • @robmulla
      @robmulla  2 года назад

      If you are using something like random grid search or grid search in sklearn - it essentially provides a generator object which you iterate over. You simply need to wrap that generator with tqdm and have a total= the number of iterations you will run. Check out this walkthrough looks to have a good example: www.jpytr.com/post/lazy_tuning/

    • @nerassurdo
      @nerassurdo 2 года назад

      @@robmulla Thank you... that looks surprisingly simple, though they did not have the "total=" portion that you mention. By the way, what is your favorite way to tune hyper-parameters since you linked to this "lazy tuning" article? I read about Halving Grid Search recently. Wondering if there's better ways you came across in your experience.

  • @minhnguyenquang6248
    @minhnguyenquang6248 Год назад +1

    It's great, thanks bro!

    • @robmulla
      @robmulla  Год назад

      Thanks for watching!

  • @89Sawik
    @89Sawik 2 года назад +1

    It would be great to hear some of your thoughts on progress bar for multiprocessing stuff. For me it was a real pain in the back to make it work xD

    • @robmulla
      @robmulla  2 года назад

      Yea, nested tqdm bars can be annoying. Sometimes it's best to test on a subset of the data and then disable them for the actual run.

    • @89Sawik
      @89Sawik 2 года назад +2

      @@robmulla i meant traking progress of calculations spread between multiple processes by means id multiprocessing package. I ended up manually updating progress bar after checking number of items in shared queue.

  • @dingaroo2003
    @dingaroo2003 2 года назад +1

    Hi Rob, greetings from Singapore!
    I am coding following along with the video, but the section on TQDM and Pandas, doesn't seem to work for me. Both scenarios are a no go for me. Please enlighten.
    Thank you very much in advance.
    PS: I find your shorts and videos very helpful, helping me fall asleep, or rather, keeping me away, thinking how I can integrate into my code portfolio!

    • @robmulla
      @robmulla  Год назад +1

      Glad you've found my videos helpful. I'm not sure what exactly your issue is. Sometimes you need to provide the total=len(df) to get tqdm to work correctly on dataframes. Hope that helps.

  • @mtamjidhossain
    @mtamjidhossain 2 года назад +1

    Nice video, do you mind sharing what theme are you using for jupyter notebook?

    • @robmulla
      @robmulla  2 года назад +1

      Thanks for the feedback. I'm using the Nord theme which can be installed from here: github.com/arbennett/jupyterlab-themes there are a lot of other good ones too.

  • @binotabao7278
    @binotabao7278 2 года назад +1

    Love your helpful videos. Could you show me the way to set up the underline Separator (_) for a number when typing in code cell, for example 50_000. Thank you.

    • @robmulla
      @robmulla  Год назад +1

      Basically in the newer versions of python you can add _ to any integer and not have an issue. I like to use them to make large numbers easier to read. 1000000 becomes 1_000_000

  • @escolaparapobres
    @escolaparapobres 2 года назад +1

    Hey, I'm Brazil, How to implement for current tasks?

    • @robmulla
      @robmulla  2 года назад

      Hey, thanks for watching. Not sure what you mean by current tasks. If you wrap your current loop in tqdm it will display a progress bar. Hope that helps.

  • @telmomachado1490
    @telmomachado1490 2 года назад +1

    Could you make a video teaching how to generate combination number and saving in Excel? and at each end of the 1048576 line it generates a new excel. I have an excel generator but it creates in folders on the side, inside the same file so it is very heavy, but if you make a file in each folder, it would be ideal. like the mega sena, and instead of generating all the possibilities, leave a field to generate combinations only with the numbers that we would prefer. here's the tip. it would be great, thanks.

    • @robmulla
      @robmulla  2 года назад

      Hey Telmo. Thanks for writing this comment. This sounds like a very specific case and I’m not sure I follow exactly what you are looking to do. It might be something you could have better luck asking on my discord? Hope you figure out a good solution.

  • @1811artur
    @1811artur 7 месяцев назад

    very usefull

  • @jasonsykes4199
    @jasonsykes4199 2 года назад +1

    I am trying to use
    "with torch.no_grad():
    for idx, data in enumerate(tbar):"
    on my own code, but keep getting a " 0%| | 0/1 [00:00

    • @jasonsykes4199
      @jasonsykes4199 2 года назад +1

      tbar = tqdm(val_loader, file=sys.stdout)

    • @robmulla
      @robmulla  2 года назад +1

      Hey Jason. I’m not aware of any reason why it would work on Kaggle but not vscode. Are you using tqdm.auto? Maybe try forcing it to use the base tqdm?

    • @dingaroo2003
      @dingaroo2003 2 года назад

      @@robmulla how do you do that?

    • @robmulla
      @robmulla  2 года назад

      @@dingaroo2003 from tqdm.auto import tqdm

  • @resresres1
    @resresres1 2 года назад +1

    I would be impressed if tqdm could give a progress bar when reading a excel or csv file as a dataframe.

    • @robmulla
      @robmulla  2 года назад

      I think it can if you use chunking when reading. Pretty sure I’ve seen it before.

    • @resresres1
      @resresres1 2 года назад +1

      @@robmulla hmm thanks for that comment about chunking. Found some interesting ideas regarding it. I assume it possible to use chunking with other types of libraries that load files? I have one program that uses pythonOCC library to load model .STL files, would love to get a progress bar for reading those files into the program.

  • @jessemutiga6055
    @jessemutiga6055 2 года назад +1

    Please sir, do a KeyWord Extraction video

    • @robmulla
      @robmulla  2 года назад

      Thanks for the feedback. I’ll see what I can do.

    • @jessemutiga6055
      @jessemutiga6055 2 года назад

      @@robmulla my humble request to you would be to expand the bert sentiment analysis video to include bert keyword extraction from the Amazon dataset - this would be phenomenal.

  • @MichaelWathen-o7x
    @MichaelWathen-o7x 4 месяца назад

    Carolyn Spring

  • @AttleeBen-g9l
    @AttleeBen-g9l 4 месяца назад

    Maggio Walks

  • @ErinBlair-h5l
    @ErinBlair-h5l 3 месяца назад

    Greyson Shoals

  • @KatiRuzicki-r9f
    @KatiRuzicki-r9f 4 месяца назад

    Flatley Pines

  • @DorothyWalker-l9t
    @DorothyWalker-l9t 4 месяца назад

    Haley Knolls

  • @AlbertXavier-t7t
    @AlbertXavier-t7t 4 месяца назад

    McLaughlin Vista

  • @BettyCollier-r2f
    @BettyCollier-r2f 4 месяца назад

    Alvina Cliffs

  • @ErikStephenson-d8d
    @ErikStephenson-d8d 4 месяца назад

    McClure Crest

  • @KathyrnGierisch-e8l
    @KathyrnGierisch-e8l 4 месяца назад

    Jones Radial

  • @HamiltonTruman-l1f
    @HamiltonTruman-l1f 4 месяца назад

    Miller Forge

  • @HudsonAldrich-g7l
    @HudsonAldrich-g7l 3 месяца назад

    Rippin Groves

  • @SteinbeckMaxwell-s8b
    @SteinbeckMaxwell-s8b 3 месяца назад

    Royal Stravenue

  • @FordAdam-h7v
    @FordAdam-h7v 3 месяца назад

    Blick Radial

  • @TarynHeimlich-y2q
    @TarynHeimlich-y2q 4 месяца назад

    Durward Prairie

  • @HenriettaAdam-b6o
    @HenriettaAdam-b6o 3 месяца назад

    Abshire Haven

  • @ThomasNiemann-e6n
    @ThomasNiemann-e6n 4 месяца назад

    Schultz Cliffs

  • @HarlanMennecke-g6i
    @HarlanMennecke-g6i 4 месяца назад

    Leone Vista

  • @RoseZachary-u4s
    @RoseZachary-u4s 4 месяца назад

    Conner Circles

  • @DonationDozen-p6m
    @DonationDozen-p6m 3 месяца назад

    Sherwood Dale

  • @JoySchafer-l3i
    @JoySchafer-l3i 3 месяца назад

    Runolfsson Divide

  • @FaulknerHaley-c3c
    @FaulknerHaley-c3c 4 месяца назад

    Gerlach Avenue

  • @MontgomeryBridget-v3u
    @MontgomeryBridget-v3u 3 месяца назад

    Alexis Circles

  • @SusannaFlora-x3o
    @SusannaFlora-x3o 4 месяца назад

    Jast Haven

  • @BuckleKaren-u6n
    @BuckleKaren-u6n 4 месяца назад

    Judd Route

  • @CopperfieldSpring-g1n
    @CopperfieldSpring-g1n 3 месяца назад

    McClure Bridge

  • @MarlowePeter-p5f
    @MarlowePeter-p5f 3 месяца назад

    Erna Corner

  • @KathleenCarroll-i8i
    @KathleenCarroll-i8i 4 месяца назад

    Bartoletti Crest

  • @ConnorJesse-f7s
    @ConnorJesse-f7s 4 месяца назад

    Stanford Crossing

  • @MaryEdwards-t9f
    @MaryEdwards-t9f 4 месяца назад

    Torrey Shores

  • @kurtdunce3965
    @kurtdunce3965 3 месяца назад

    Goodwin Passage

  • @ScottDaphne-u4p
    @ScottDaphne-u4p 4 месяца назад

    Adolphus Oval

  • @CarolKennedy-u8x
    @CarolKennedy-u8x 4 месяца назад

    Clifton Isle

  • @JacquelineMosley-r6m
    @JacquelineMosley-r6m 4 месяца назад

    Ritchie Circle

  • @EugeneWolfe-d2x
    @EugeneWolfe-d2x 4 месяца назад

    Cornell Plaza

  • @JessicaClark-i8v
    @JessicaClark-i8v 3 месяца назад

    Witting Harbor

  • @tradertrader2649
    @tradertrader2649 2 года назад

    how about `df.isnull().sum()` how can i use tqdm here

    • @robmulla
      @robmulla  2 года назад

      Not sure if you can because it's vectorized already.

  • @MelissaThompson-t6t
    @MelissaThompson-t6t 3 месяца назад

    Treutel Glen

  • @FrankWilliams-r4b
    @FrankWilliams-r4b 4 месяца назад

    Luna Harbors

  • @NancyLouise-g4e
    @NancyLouise-g4e 4 месяца назад

    Rhoda Expressway

  • @CarterMortimer-p9e
    @CarterMortimer-p9e 4 месяца назад

    Jacobs Place

  • @MarieFox-c1s
    @MarieFox-c1s 4 месяца назад

    Annabel Shore

  • @WheatleyZero-d2j
    @WheatleyZero-d2j 4 месяца назад

    Sawayn Mountain

  • @VeraStringer-w5e
    @VeraStringer-w5e 4 месяца назад

    Goyette Ridge

  • @AlbertHarvey-g4m
    @AlbertHarvey-g4m 3 месяца назад

    Roob Hollow

  • @CarllyleChristie-f7r
    @CarllyleChristie-f7r 4 месяца назад

    O'Keefe Motorway

  • @MaryWalker-w4g
    @MaryWalker-w4g 4 месяца назад

    Veum Harbor

  • @NoahAgnes-m2z
    @NoahAgnes-m2z 3 месяца назад

    Sandrine Squares

  • @JanetJones-j2s
    @JanetJones-j2s 4 месяца назад

    Josefina Mission

  • @JoannReyes-u6z
    @JoannReyes-u6z 4 месяца назад

    Shad Prairie

  • @NormandAmes-d2s
    @NormandAmes-d2s 4 месяца назад

    Rosenbaum Greens

  • @MarylynnFontus-q5j
    @MarylynnFontus-q5j 4 месяца назад

    Oberbrunner Mills

  • @JimmyMurphy-x2t
    @JimmyMurphy-x2t 5 месяцев назад

    Bernhard Crescent

  • @JuleeDrewing-z5m
    @JuleeDrewing-z5m 4 месяца назад

    Maggie Circle

  • @WalterPowers-e8h
    @WalterPowers-e8h 4 месяца назад

    Leopold Vista

  • @BlakeHumphrey-l5f
    @BlakeHumphrey-l5f 4 месяца назад

    Claudine Rapid

  • @LilyLawrence-l6w
    @LilyLawrence-l6w 3 месяца назад

    Boyle Rapids

  • @KelsenTom-h2m
    @KelsenTom-h2m 4 месяца назад

    Daniel Mountain

  • @BrettMcdale-m7c
    @BrettMcdale-m7c 4 месяца назад

    Bins Haven

  • @DavidEarheart-u1h
    @DavidEarheart-u1h 4 месяца назад

    Jillian Summit

  • @HenrySieg-w6v
    @HenrySieg-w6v 4 месяца назад

    Hintz Ridges

  • @MaxOmar-t5n
    @MaxOmar-t5n 4 месяца назад

    Brekke Branch

  • @PaulaChristensen-y7s
    @PaulaChristensen-y7s 4 месяца назад

    Schmidt Garden

  • @AustinElliot-g3v
    @AustinElliot-g3v 4 месяца назад

    Hane Summit

  • @WordsworthAugustine-t8e
    @WordsworthAugustine-t8e 3 месяца назад

    Matilda Heights

  • @EvelynWhite-p5j
    @EvelynWhite-p5j 4 месяца назад

    Jerde Ridge

  • @LenaElvis-j5u
    @LenaElvis-j5u 4 месяца назад

    Myrtle Glens

  • @ThompsonMadge-n6s
    @ThompsonMadge-n6s 4 месяца назад

    Friesen Mount

  • @MichelleWhite-o8v
    @MichelleWhite-o8v 4 месяца назад

    Emilia Plains