question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ProgressBar for `.apply` when looping over rows

See original GitHub issue

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 20.04.4 LTS
  • Modin version (modin.__version__): 0.14.1
  • Python version: 3.8
  • Code we can use to reproduce:
import modin.pandas as pd
import tqdm
from modin.config import ProgressBar
ProgressBar.enable()

X = pd.DataFrame([[1,2,3]]*100, columns=["a", "b", "c"]) # be wary that this produces its own progress bar
X.apply(lambda x: 1, axis=1) # does not produce progress bar; if axis=0, progress bar is produced

Describe the problem

The ProgressBar seems to not appear when apply is used with axis=1 (iterating over rows). It does appear for axis=0, but oddly not if a Series is returned (common pattern for constructing new dataframes). If running the example, be careful to disregard the progress bar generated by the pd.Dataframe command.

Source code / logs

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mvashishthacommented, May 9, 2022

@Bonnevie I would also like to add to @jeffreykennethli 's response:

  • Issue #4167 says that we’re missing some functions at the internal level of the Modin dataframe. Among those are the ones we would need to give an estimate of apply progress. I think just making apply work shouldn’t be too much effort. I mentioned it in a comment on #4167 and we will try to address the feature soon.
  • Each progress bar should tell users which frame-level operation it’s for. In the case of axis=0 apply that you show here, it should explain that it’s showing the progress of the transpose. I have filed #4447 for that new feature.
0reactions
mvashishthacommented, Aug 16, 2022

@Bonnevie I’m closing this issue. If you have any more concerns, please comment here. We’ll continue tracking work on the followups: https://github.com/modin-project/modin/issues/4443#issuecomment-1121221578

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can you show progress bar while iterating over a pandas ...
I wanted to know how could I use a progress bar to add a visual representation of how far along I am. I...
Read more >
Track your loop using tqdm: 7 ways progress bars in Python ...
Track your loop using tqdm: 7 ways progress bars in Python make things easier. Track the your Python loops with a real-time progress...
Read more >
Pandas progress bar when iterating over rows #322 - GitHub
Pandas progress bar when iterating over rows #322 ... total when running apply(axis=1), i.e. applying a function to each row of a dataframe....
Read more >
How to Use Progress Bars in Python? | tqdm and tqdm Notebook
It is evident that tqdm() has more progress bars. For each iteration of Loop 1, it shows a separate progress bar and in...
Read more >
Loop through workbooks in a folder, with progress bar.
Hello everyone, The code below loops through multiple files in folder. I would like to write code which displays progress bar with ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found