Visualize¶
-
tinder.batch.
iter_from_iter
(iterable, batch_size, drop_last=False, total=None)[source]¶ Batchify given iterable.
if the given iterable has __len__(), this returns the iterable with __len()__.
Example:
import tqdm import tinder import time for i in tqdm.tqdm(tinder.batch(range(100), 4, total=14)): print(i) time.sleep(0.2) def f(): for i in range(30): yield i for i in tqdm.tqdm(tinder.batch(f(), 4)): print(i) time.sleep(0.2)