Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
1576 views


:T#XH�@s+ddlZdZdgZdd�ZdS)�Nzgithub.com/casperdcl�tqdm_pandascOs�ddlm}t|t�s:t|dd�jd�r{|ddt|jdd	�d
tjj	��|j
||�n;|ddt|jd
tjj	��t|�j
d|�d	S)
a]
    Registers the given `tqdm` instance with
    `pandas.core.groupby.DataFrameGroupBy.progress_apply`.
    It will even close() the `tqdm` instance upon completion.

    Parameters
    ----------
    tclass  : tqdm class you want to use (eg, tqdm, tqdm_notebook, etc)
    targs and tkwargs  : arguments for the tqdm instance

    Examples
    --------
    >>> import pandas as pd
    >>> import numpy as np
    >>> from tqdm import tqdm, tqdm_pandas
    >>>
    >>> df = pd.DataFrame(np.random.randint(0, 100, (100000, 6)))
    >>> tqdm_pandas(tqdm, leave=True)  # can use tqdm_gui, optional kwargs, etc
    >>> # Now you can use `progress_apply` instead of `apply`
    >>> df.groupby(0).progress_apply(lambda x: x**2)

    References
    ----------
    https://stackoverflow.com/questions/18603270/
    progress-indicator-during-pandas-operations-python
    r)�TqdmDeprecationWarning�__name__�Ztqdm_zCPlease use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm, ...)`.
�fp_write�fileN�writezCPlease use `tqdm.pandas(...)` instead of `tqdm_pandas(tqdm(...))`.
�deprecated_t)�tqdmr�
isinstance�type�getattr�
startswith�get�sys�stderrr�pandas�fp)�tclass�targs�tkwargsr�r�V/projects/382bb574-6d4d-4998-962a-4389b3ceddc1/vanguard_tutorials/tqdm/_tqdm_pandas.pyrs!	+")r�
__author__�__all__rrrrr�<module>s