# pip install tqdm
from tqdm import tqdm_notebook
# works on any iterable, including cursors.
# for iterables with len(), no need to specify 'total'.
for rec in tqdm_notebook(positions_collection.find(),total=positions_collection.count(),desc="Processing records"):
len(rec.keys())
NameError Traceback (most recent call last)
<ipython-input-1-e3f8d3beb57d> in <module>()
4 # works on any iterable, including cursors.
5 # for iterables with len(), no need to specify 'total'.
----> 6 for rec in tqdm_notebook(positions_collection.find(),total=positions_collection.count(),desc="Processing records"):
7 len(rec.keys())
NameError: name 'positions_collection' is not defined