Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by predictivehacks.com #
 
PREVIOUS NEXT
Tagged: #How #Add #Progress #Bar #Pandas #Apply
ADD COMMENT
Topic
Name
9+9 =