
    .i                     d    d dl Zd dl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)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       g/var/www/app/trading-bot/venv/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)ar5   bcdstr_datar   )r   r   r5   r   r.   r   r2   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_timedelta64/   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_periodB   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.   rD   r    r   r   )	r   objectr!   npnanr"   r#   isnanilocr%   sr'   r(   s       r)   test_describe_empty_objectz-TestSeriesDescribe.test_describe_empty_objectO   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_fixturerQ   r   startendrL   r'   r(   s	            r)   test_describe_with_tzz(TestSeriesDescribe.test_describe_with_tz`   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CETrO   r   r   rP   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:00rR   r   )r	   r   r
   r!   r"   r#   )r%   r   rQ   rV   rW   rL   r'   r(   s           r)   test_describe_with_tz_numericz0TestSeriesDescribe.test_describe_with_tz_numericw   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-03rR   )r    )r   r
   r!   r	   r"   r#   rK   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(  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   rC   z$^a must be an array of real numbers$)matchg       @g      ?g      ?g      ?g      ?r   )r    rD   )
r   r   r   pytestraises	TypeErrorr!   r   r"   r#   )r%   any_numeric_dtyperD   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 !H   		 N
 	vx0) s   B44B=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        ra   rC   r   r   r   rE   )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*   r3   r:   r=   rA   rM   rX   r[   r_   rd   markfilterwarningsrh   rk    r+   r)   r   r      sY    1111&1("1.1.1" [[ PQ1 R1>
1r+   r   )numpyrG   rd   pandas.core.dtypes.commonr   r   pandasr   r   r   r   r	   r
   pandas._testing_testingr"   r   rq   r+   r)   <module>rw      s+     
  u1 u1r+   