-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
duplicate 🗐Seen it beforeSeen it beforep2-bug-warning ⚠Visual output badVisual output badp3-enhancement 🔥Much new such featureMuch new such feature
Description
Maybe this is already taken care of and I just don't know how to use the pandas implementation correctly, but the tqdm progress bar returns an incorrect total when running apply(axis=1), i.e. applying a function to each row of a dataframe. I have implemented the following fix for myself, but could something similar be added to the official code? Thanks!
# Precompute total iterations
if kwargs.get('axis', 0) == 1:
total = len(df)
else:
total = getattr(df, 'ngroups', None)
if total is None: # not grouped
total = len(df) if isinstance(df, Series) \
else df.size // len(df)
else:
total += 1 # pandas calls update once too many
Metadata
Metadata
Assignees
Labels
duplicate 🗐Seen it beforeSeen it beforep2-bug-warning ⚠Visual output badVisual output badp3-enhancement 🔥Much new such featureMuch new such feature