Answers for "How to Add a Progress Bar into Pandas Apply"

0

How to Add a Progress Bar into Pandas Apply

If you are applying any function on pandas dataframe column and want to track the progress
you can use the following command

import pandas as pd
from tqdm.notebook import tqdm
tqdm.pandas()

# instead of apply use `progress_apply`
df['col'].progress_apply(lambda x: x**2)

## If you get any error like `ImportError: IProgress not found` then you can install/update your
jupyter and Ipywidgets packages using following command
1. pip install ipywidgets==7.4.2
Posted by: Guest on March-23-2022

Code answers related to "How to Add a Progress Bar into Pandas Apply"

Python Answers by Framework

Browse Popular Code Answers by Language