progress_map on panda's index
masalha-alaa opened this issue · comments
Alaa commented
- I have marked all applicable categories:
- documentation request (i.e. "X is missing from the documentation." If instead I want to ask "how to use X?" I understand StackOverflow#tqdm is more appropriate)
- new feature request
- I have visited the source website, and in particular
read the known issues - I have searched through the issue tracker for duplicates
- I have mentioned version numbers, operating system and
environment, where applicable:import tqdm, sys print(tqdm.__version__, sys.version, sys.platform) # 4.66.2 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] linux
Issue:
progress_map
on pandas index is not supported:
from tqdm.auto import tqdm
tqdm.pandas()
import pandas as pd
df = pd.DataFrame(data=list(range(5)), columns=['x'])
df['x'].progress_map(lambda x: x**2) # => works and shows progress bar
df.index.map(lambda x: x**2) # => prints index values squared
df.index.progress_map(lambda x: x**2) # => error: AttributeError: 'RangeIndex' object has no attribute 'progress_map'
Expected behavior (feature request):
df.index.progress_map
should show progress bar.