MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / tqdm_pandas

Function tqdm_pandas

pager_lib/tqdm/_tqdm_pandas.py:7–24  ·  view source on GitHub ↗

Registers the given `tqdm` instance with `pandas.core.groupby.DataFrameGroupBy.progress_apply`.

(tclass, **tqdm_kwargs)

Source from the content-addressed store, hash-verified

5
6
7def tqdm_pandas(tclass, **tqdm_kwargs):
8 """
9 Registers the given `tqdm` instance with
10 `pandas.core.groupby.DataFrameGroupBy.progress_apply`.
11 """
12 from tqdm import TqdmDeprecationWarning
13
14 if isinstance(tclass, type) or (getattr(tclass, '__name__', '').startswith(
15 'tqdm_')): # delayed adapter case
16 TqdmDeprecationWarning(
17 "Please use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm, ...)`.",
18 fp_write=getattr(tqdm_kwargs.get('file', None), 'write', sys.stderr.write))
19 tclass.pandas(**tqdm_kwargs)
20 else:
21 TqdmDeprecationWarning(
22 "Please use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm(...))`.",
23 fp_write=getattr(tclass.fp, 'write', sys.stderr.write))
24 type(tclass).pandas(deprecated_t=tclass)

Callers

nothing calls this directly

Calls 3

pandasMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected