ProgressBar for `.apply` when looping over rows
See original GitHub issueSystem 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:
- Created a year ago
- Comments:5 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Bonnevie I would also like to add to @jeffreykennethli 's response:
apply
progress. I think just makingapply
work shouldn’t be too much effort. I mentioned it in a comment on #4167 and we will try to address the feature soon.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.@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