pandarallel
pandarallel copied to clipboard
Fix #191: `TypeError: 'generator' object is not subscriptable` when using colab
Fix #191 Didn't find a way of doing this that doesn't convert the generator to a list, unfortunately.
To check that it works in colab (adapted from @agiveon's example):
!pip install -U --no-cache-dir https://github.com/till-m/pandarallel/archive/fix191.zip
from pandarallel import pandarallel
pandarallel.initialize(progress_bar=True)
import pandas as pd
data = {'Name': ['Tom', 'Joseph', 'Krish', 'John'], 'Age': [20, 21, 19, 18]}
df = pd.DataFrame(data)
df['HalfAge'] = df.parallel_apply(lambda r: r.Age/2,axis=1)
I encounter the same issue. Could we review and merge it?
Hi @csqzhang, @nalepae maintains this package in his spare time, so he's not always able to take care of reviews etc. immediately. Until then, feel free to either use a previous version without this bug by running !pip install pandarallel==1.6.1
(if what you are doing is not impacted by #74) or use the patched version by installing from my branch pip install https://github.com/till-m/pandarallel/archive/fix191.zip
.
Fixed in pandarallel v1.6.3
.
Thank you @till-m!