Open Nicolas-Reyland opened 1 year ago
If you wonder about my use case, here is an example: pandas dataframes have many iterators. For example, if you want to iterate over a dataframe using the itertuples
method, you find yourself with a valid iterator for which you know the length (df.shape[0]
), but which can't be thrown to the atpbar
function. What I ended up doing was this:
Atpbar = type(atpbar([1, 2, 3]))
. And then later: for row_a in Atpbar(a.itertuples(), len_=a.shape[0], ...)
.
I don't find this very elegant. I am open to suggestions.
Exporting the Atpbar class, so that progress bars can be created for iterable objects for which one knows then length, but for which the
__len__()
method is not implemented.