U
    Ãmœd  ã                   @   sþ  d dl mZ d dlZd dlmZmZ d dlZd dl	m
Z
mZmZmZ ddddd	d
dddddddddddddddgZeejƒZeedƒk Zeedƒk Zeedƒk Zzd dlmZ W n  ek
rÐ   d dlmZ Y nX zd dlmZ W n" ek
�r   d dlmZ Y nX ejejfZzd dlmZ W n( ek
�rJ   d dl m!  mZ Y nX ej"Z"ej#Z#ej$Z$ej%e&d œd!d„Z'ej%e&d œd"d„Z(zd d#l)m*Z+ W n0 ek
�rÂ   d dl,Z,d.d%d&„Z-d'd„ Z+Y nX ejej.d(œd)d„Z/d*d„ Z0d+d„ Z1ee2 d,œd-d„Z3dS )/é    )ÚOptionalN)ÚVersionÚparse)ÚAppenderÚSubstitutionÚcache_readonlyÚdeprecate_kwargÚassert_frame_equalÚassert_index_equalÚassert_series_equalÚdata_klassesÚfrequenciesÚis_numeric_dtypeÚtestingr   r   r   r   Úis_int_indexÚis_float_indexÚmake_dataframeÚto_numpyÚPD_LT_1_0_0Úget_cached_funcÚget_cached_docÚcall_cached_funcÚ	PD_LT_1_4ÚPD_LT_2z1.0.0z1.3.99z1.9.99)r   )Úoffsets)r   )ÚindexÚreturnc                 C   s*   t | tjƒo(t | jtjƒo(t | jtj¡S )zÑ
    Check if an index is integral

    Parameters
    ----------
    index : pd.Index
        Any numeric index

    Returns
    -------
    bool
        True if is an index with a standard integral type
    )Ú
isinstanceÚpdÚIndexÚdtypeÚnpÚ
issubdtypeÚinteger©r   © r%   úR/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/statsmodels/compat/pandas.pyr   A   s
    ÿýc                 C   s*   t | tjƒo(t | jtjƒo(t | jtj¡S )zÕ
    Check if an index is floating

    Parameters
    ----------
    index : pd.Index
        Any numeric index

    Returns
    -------
    bool
        True if an index with a standard numpy floating dtype
    )r   r   r   r    r!   r"   Zfloatingr$   r%   r%   r&   r   V   s
    ÿý)ÚmakeDataFrameÚOc                 C   sf   t jttjtj ƒt jdfd�}t jj|| t  	|¡ d� 
t j| f¡ |¡}|dkrX|S | |¡S dS )z4
        Generate an array of byte strings.
        é   )r    )ÚsizeN)r!   ÚarrayÚlistÚstringÚascii_lettersÚdigitsZstr_ÚrandomÚchoiceÚprodÚviewZreshapeZastype)Úncharsr*   r    Zrands_charsÚretvalr%   r%   r&   Úrands_arrayp   s     ÿÿþÿr6   c                     sF   d‰d} t jtdˆd�dd�‰ ‡ ‡fdd„tjd| … D ƒ}t  |¡S )	z@
        Simple verion of pandas._testing.makeDataFrame
        é   é   é
   )r4   r*   N)Únamec                    s$   i | ]}|t jtj ˆ¡ˆ d �“qS )r$   )r   ÚSeriesr!   r0   Zrandn)Ú.0Úc©r   Únr%   r&   Ú
<dictcomp>ˆ   s   ÿ z"make_dataframe.<locals>.<dictcomp>)r   r   r6   r-   Úascii_uppercaseÚ	DataFrame)ÚkÚdatar%   r>   r&   r   �   s    þ)Úpor   c                 C   s*   z
|   ¡ W S  tk
r$   | j Y S X dS )z¤
    Workaround legacy pandas lacking to_numpy

    Parameters
    ----------
    po : Pandas obkect

    Returns
    -------
    ndarray
        A numpy array
    N)r   ÚAttributeErrorÚvalues)rE   r%   r%   r&   r   �   s    
c                 C   s(   z| j W S  tk
r"   | j Y S X d S ©N)ÚfgetrF   Úfunc©Úcached_propr%   r%   r&   r   £   s    c                 O   s   t | ƒ}|||ŽS rH   )r   )rL   ÚargsÚkwargsÚfr%   r%   r&   r   ª   s    )r   c                 C   s
   t | ƒjS rH   )r   Ú__doc__rK   r%   r%   r&   r   ¯   s    )r(   )4Útypingr   Únumpyr!   Zpackaging.versionr   r   Zpandasr   Zpandas.util._decoratorsr   r   r   r   Ú__all__Ú__version__Úversionr   r   r   Zpandas.api.typesr   ÚImportErrorZpandas.core.commonZpandas.tseriesr   r   r;   rB   r   Zpandas.testingr   Zpandas.util.testingÚutilr	   r
   r   r   Úboolr   r   Zpandas._testingr'   r   r-   r6   Zndarrayr   r   r   Ústrr   r%   r%   r%   r&   Ú<module>   st   ë

