
    Owg                     p    d dl Zd dlZd dlmZ d dlmZmZ d dlm	Z	m
Z
mZmZmZmZ d dlmZ  G d d      Zy)    N)np_version_gte1p25)is_complex_dtypeis_extension_array_dtype)NAPeriodSeries	Timedelta	Timestamp
date_rangec                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zej                  j                  d
      d        Zd Zy)TestSeriesDescribec           
          t        g dd      }|j                         }t        dd|j                         ddddd	gdg d
      }t        j                  ||       y )N)r               int_dataname   r   r   r   r   r   countmeanstdmin25%50%75%maxr   index)r   describer   tmassert_series_equalselfserresultexpecteds       `/var/www/horilla/myenv/lib/python3.12/site-packages/pandas/tests/series/methods/test_describe.pytest_describe_intsz%TestSeriesDescribe.test_describe_ints   sU    _:63779aAq!,M

 	vx0    c                     t        g dd      }|j                         }t        g ddg d      }t        j                  ||       y )N)TTFFF	bool_datar   )r   r   Fr   r   uniquetopfreqr    r   r"   r#   r$   r%   s       r*   test_describe_boolsz&TestSeriesDescribe.test_describe_bools!   s>    6[I;6X
 	vx0r,   c                     t        g dd      }|j                         }t        g ddg d      }t        j                  ||       y )N)ar6   bcdstr_datar   )r   r   r6   r   r/   r    r3   r%   s       r*   test_describe_strsz%TestSeriesDescribe.test_describe_strs)   s>    .Z@3U
 	vx0r,   c                 >   t        t        d      t        d      t        d      t        d      t        d      gd      }|j                         }t        d|d	   |j                         |d
   |d   |d	   |d   |d   gdg d      }t	        j
                  ||       y )Nz1 daysz2 daysz3 daysz4 daysz5 daystimedelta_datar   r   r   r   r   r   r   r   r    )r   r	   r"   r   r#   r$   r%   s       r*   test_describe_timedelta64z,TestSeriesDescribe.test_describe_timedelta641   s    (#(#(#(#(# "	
 A	3q63q63q63q63q6J!M

 	vx0r,   c                     t        t        dd      t        dd      t        dd      gd      }|j                         }t        dd|d   dgdg d	
      }t        j                  ||       y )Nz2020-01Mz2019-12period_datar   r   r   r   r/   r    )r   r   r"   r#   r$   r%   s       r*   test_describe_periodz'TestSeriesDescribe.test_describe_periodD   sm    Is#VIs%;VIs=ST
 3q614

 	vx0r,   c                    t        d d gt              }|j                         }t        ddt        j                  t        j                  gt        g d      }t        j                  ||       |d d j                         }t        j                  ||       t        j                  |j                  d         sJ t        j                  |j                  d         sJ y )Ndtyper   r/   rE   r!   r   r   )	r   objectr"   npnanr#   r$   isnanilocr&   sr(   r)   s       r*   test_describe_empty_objectz-TestSeriesDescribe.test_describe_empty_objectQ   s    D$<v.266266"4

 	vx02A!
vx0xxA'''xxA'''r,   c                    |}t        |      }t        ddd      }t        ddd      }t        t        |||      |      }|j	                         }t        dt        ddd      j                  |      |j                  |      |d   |d   |d   |j                  |      g|g d	      }t        j                  ||       y )
N  r   r   tzr   r   r   r   r   r   r   r   r   r   r    )strr
   r   r   r"   tz_localizer#   r$   )	r&   tz_naive_fixturerR   r   startendrM   r(   r)   s	            r*   test_describe_with_tzz(TestSeriesDescribe.test_describe_with_tzb   s    #$$1%a#:eSR0t<$1%11"5!!"%!!!# F
 	vx0r,   c                 p   dx}}t        ddd      }t        ddd      }t        t        |||      |      }|j                         }t        dt        d|      t        d|      t        d	|      t        d|      t        d
|      t        d|      g|g d      }t	        j
                  ||       y )NCETrP   r   r   rQ   r   z2018-01-03 00:00:00z2018-01-01 00:00:00z2018-01-02 00:00:00z2018-01-04 00:00:00z2018-01-05 00:00:00rS   r    )r
   r   r   r"   r#   r$   )r&   r   rR   rW   rX   rM   r(   r)   s           r*   test_describe_with_tz_numericz0TestSeriesDescribe.test_describe_with_tz_numericy   s    r$1%a#:eSR0t</B7/B7/B7/B7/B7/B7 F
 	vx0r,   c                    t        t        dd            }|j                         }t        dt        d      t        d      t        d      t        d      t        d      t        d      gg d	
      }t	        j
                  ||       y )N2012r   )periodsz
2012-01-02z
2012-01-01z2012-01-01T12:00:00z2012-01-02T12:00:00z
2012-01-03rS   )r!   )r   r   r"   r
   r#   r$   rL   s       r*   *test_datetime_is_numeric_includes_datetimez=TestSeriesDescribe.test_datetime_is_numeric_includes_datetime   sz    :fa01,','/0,'/0,' G
 	vx0r,   z.ignore:Casting complex values to real discardsc           
         t        |      rd}nt        |      rdnd }t        ddg|      }|dk(  r;t        r5t	        j
                  t        d      5  |j                          d d d        y |j                         }t        dd	|j                         dd
d	ddgg d|      }t        j                  ||       y # 1 sw Y   y xY w)NFloat64
complex128r   r   rD   z$^a must be an array of real numbers$)matchg       @g      ?g      ?g      ?g      ?r   )r!   rE   )r   r   r   r   pytestraises	TypeErrorr"   r   r#   r$   )r&   any_numeric_dtyperE   r'   r(   r)   s         r*   test_numeric_result_dtypez,TestSeriesDescribe.test_numeric_result_dtype   s     $$56E$45F$GLTEaV#45L %7!H   		 N
 	vx0) s   B::Cc           
          t        dgd      }t        j                  d       5  |j                         }d d d        t        ddt        dddddgdg d      }t        j
                  |       y # 1 sw Y   <xY w)Ng        rb   rD   r   r   r   rF   )r   r#   assert_produces_warningr"   r   r$   r%   s       r*   test_describe_one_element_eaz/TestSeriesDescribe.test_describe_one_element_ea   st    cU),''- 	$\\^F	$2q!Q1%M

 	vx0	$ 	$s   A00A9N)__name__
__module____qualname__r+   r4   r;   r>   rB   rN   rY   r\   r`   re   markfilterwarningsri   rl    r,   r*   r   r      sY    1111&1("1.1.1" [[ PQ1 R1>
1r,   r   )numpyrH   re   pandas.compat.numpyr   pandas.core.dtypes.commonr   r   pandasr   r   r   r	   r
   r   pandas._testing_testingr#   r   rr   r,   r*   <module>ry      s.      2
  u1 u1r,   