
    [6g                       d dl Z d dlmZmZmZmZ d dlmZ d dlm	Z	 d dl
mZm
Z
mZ d dlZd dlZd dlZd dlmZ d dlmZ d dlZd dlZd dlmZ d d	lmZ d d
lmZ d dlmZ d dlmc m Z! d dl"m#Z# d dl$m%Z%m&Z&m'Z'm(Z( d dl)Z*d dl)m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9 d dl:m;Z< d dl=m>Z>m?Z?m@Z@mAZAmBZB g dZCg dZD G d d          ZE G d d          ZF G d d          ZG G d d          ZHd ZI G d d          ZJ G d d          ZKdS )    N)OrderedDictabcdefaultdict
namedtuple)Iterator)make_dataclass)datedatetime	timedelta)ma)mrecords)using_pyarrow_string_dtype)lib)np_version_gt2)IntCastingNaNError)is_integer_dtype)DatetimeTZDtypeIntervalDtypeNumpyEADtypePeriodDtype)CategoricalCategoricalIndex	DataFrameDatetimeIndexIndexInterval
MultiIndexPeriod
RangeIndexSeries	Timedelta	Timestampcut
date_rangeisna)DatetimeArrayIntervalArrayPeriodArraySparseArrayTimedeltaArray)float16float32float64)uint8uint16uint32uint64int8int16int32int64c                      e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zej                            d
ddg          d             Zd Zej                            dd d d d d d d d d d d g          d             Zej                            dd d g          d             Zej                            dg g ed            ed!          fg g g ed"           ed!          fd# d$D             g ed            ed!          fg          d%             Zd& Zd' Zd( Zd) Zd* Zej        ej                             e            d+,          d-                         Zej        ej                             e            d+,          d.                         Zd/ Z d0 Z!ej                            d1d2i gd2d d3d4d5gd6i gg          d7             Z"d8 Z#d9 Z$d: Z%d; Z&d< Z'ej                            d= e(j)        d>ge*?           e(j)        d"d@z  g          dAg e(j)        dBge*?           e(j)        dCg          d"d@z   d"z
  gg          dD             Z+ej                            d= e(j)        d ge(j,        ?           e(j)        d ge(j-        ?           e(j)        d ge(j.        ?           e(j,        d           g e(j-        d           g e(j.        d           gg          dE             Z/dF Z0dG Z1dH Z2dI Z3dJ Z4dK Z5dL Z6dM Z7ej                            dNd"e(j8        dOdPg          dQ             Z9ej                            dRd"e(j8        dO e:dS          g          dT             Z;ej                            dRe(j8        dO e:dS          g          dU             Z<dV Z=dW Z>dX Z?dY Z@dZ ZAd[ ZBd\ ZCd] ZDd^ ZEd_ ZFd` ZGda ZHdb ZIdc ZJdd ZKde ZLdf ZMdg ZNej                            dhdi djfdk dlfdm dnfdo dpfg          dq             ZOdr ZPds ZQej                            dt eRdu           eSd          f eTd!dvw           eUdxdy          f eVdzd{|           eWd}d{~          fg          d             ZXd ZYd ZZd Z[d Z\ej        ]                    d          d             Z^d Z_d Z`d Zaej                            ddO eb ecd                    ddge*e(jd        fdOdOddgdx e(je        dx          fdO eb ecd                    ddgef e(je        d          fi dOd3d4gdOe(jd        fdd i eb ecd                     ebd          ef e(je        d          fg          d             Zgej                            dg ddehji        fg ddehjj        fg ddehjk        fg ddehjl        ff          d             Zmd Znd Zod Zpd Zqd Zrd Zsd Ztd Zud Zvd Zwd Zxej                            d eVd          ggd eVd          igd eVd          gid eVd          y                    d          ig          d             Zzd Z{d Z|d Z}d Z~d Zd Zd Zd Zd Zd Zej                            deeg          d             Zej                            deeg          d             Zd Zd Zd Zd Zd Zd Zd Zej                            dd$g fd$g fdd$d$gfdg g gfg g fg g gfd gd"gfd gd"ggfg dg dfg dg dgfg          d             ZdÄ ZdĄ Zdń ZdƄ ZdǄ ZdȄ ZdɄ Zdʄ Zd˄ Zej                            dg d͢          d΄             Zdτ ZdЄ Zdф Zd҄ Zdӄ ZdԄ ZdՄ Zdք Zdׄ Zd؄ Zdل Zdڄ Zdۄ Zd܄ Zej                            d e(j)        dOdOdOdO ej                    dOg           e(j)        dOdO ej                    dOg           e(j        dަ          gdOgg e(j        dަ          gehj        ggdOg e(j        dަ          ggdOgehj        ggehj        g e(j        dަ          ggehj        gdOggg          d߄             Zej                            dg d          ej                            dg d          d                         Zej                            dg d          ej                            dg d          d                         Zd Zd Zd Zd Zd Zej                            d eg dg dgd e(j8        g           eg dg dgdde(j8        g           eg dg dge(j8        dde(j8        g           eg dg dge(j8        dde(j8        g           eg dg dge(j8        d d"d"g          g          d             Zd Zd Zd Zd Zd Zd Zd Zd Zej                            dej        ej        z   ej        z   ej        z             d             Zej                            dej        ej        z   ej        z             d             ZȐd  Zej        j        ej                            dg d          d                         Zːd Zej                            d e ebd                     ed e(j8        e(j8        e(j8        g           e eTd!d            eTd dv          g           e ehj        ddd                    g          d	             ZҐd
 ZӐd ZԐd ZՐd Z֐d Zאd Zؐd Zِd Zej                            dd d"gddg eb eېdd"d                     eb eېdd"dd{                     eTd!dvw          gg          d             Zܐd Zej                            dddg          d             Zސd Zߐd  Zd! Zd" Zej                            d#d gd"gg e(j)        d gd"gg          f e(j)        d gd"gg          d gd"ggf e(j)        d gd"gg           e(j)        d gd"gg          fg          d$             Zd% Zd& Zd' Zd( Zd) Zd* Zd+ ZdOS (,  TestDataFrameConstructorsc                    t          j        d                              dd          }t          |t                    }t          |                    t                    t                    }t          j        ||           d S )N         dtype)	nparangereshaper   strastypeobjecttmassert_frame_equal)selfarrdfexpecteds       c/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/pandas/tests/frame/test_constructors.py,test_constructor_from_ndarray_with_str_dtypezFTestDataFrameConstructors.test_constructor_from_ndarray_with_str_dtypeP   sh     imm##Aq))s#&&&SZZ__F;;;
b(+++++    c                 :   t          ddd          }|j                            dd          }t          |          }t          |d d df         |d d df         d	          }t	          j        ||           |st          |j        j                  dk    sJ d S d S )
N
2016-01-01   
US/Pacificperiodstzr;      r      r   rU   )	r$   _datar@   r   rD   rE   len_mgrblocks)rF   using_array_managerdtidtarH   rI   s         rJ   &test_constructor_from_2d_datetimearrayz@TestDataFrameConstructors.test_constructor_from_2d_datetimearrayX   s    q\BBBi1%%s^^QQQTs111a4y99::
b(+++" 	,rw~&&!++++	, 	,++rL   c                 b   t          d                              d          }|                    d          }t          d|idg          }t          d|gi          }t	          j        ||           t          |dgd          }t          |gdgd          }t	          j        ||           d S )	Nz2019-11-03 01:00:00-0700zAmerica/Los_Angelesnsdtr   indexrU   )ra   value)r"   
tz_convertas_unitr   rD   rE   )rF   ra   rH   rI   s       rJ   )test_constructor_dict_with_tzaware_scalarzCTestDataFrameConstructors.test_constructor_dict_with_tzaware_scalarc   s    122==>STTZZbz!---dRD\**
b(+++ bA3//00RDA37788
b(+++++rL   c                 r   t          j        dt           j        gddgg          }d}t          j        t
          |          5  t          |d           d d d            n# 1 swxY w Y   t          j        t
          |          5  t          |d         dd	           d d d            d S # 1 swxY w Y   d S )
NrU   rT   r;   9Cannot convert non-finite values \(NA or inf\) to integermatchi8r<   r   r=   name)r>   arraynanpytestraisesr   r   r    )rF   rG   msgs      rJ   -test_construct_ndarray_with_nas_and_int_dtypezGTestDataFrameConstructors.test_construct_ndarray_with_nas_and_int_dtypeq   s8   hBFaV,--J]-S999 	' 	'c&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' ]-S999 	/ 	/3q6A....	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/s$   A  A$'A$B,,B03B0c                     t          t          j                    t          j                    g          }|d         j        t	          j        d          k    sJ d S )Nr   M8[ns])r   r
   nowr=   r>   rF   rH   s     rJ   %test_construct_from_list_of_datetimesz?TestDataFrameConstructors.test_construct_from_list_of_datetimes|   sG    788!u{bhx00000000rL   c                 0   t          ddgd          }|                    d          }t          t          j        |                                d          d          }|j        |j        k    sJ t          |          }t          j        ||           d S )Nz2013-1-1 13:00z2013-1-2 14:00Brn   rP   rC   r<   )	r   tz_localizer    r>   ro   tolistr=   rD   assert_series_equal)rF   naiveidxrI   results        rJ   +test_constructor_from_tzaware_datetimeindexzETestDataFrameConstructors.test_constructor_from_tzaware_datetimeindex   s     /1ABMMM--"(3::<<x@@@sKKK~**** 
vx00000rL   c                     d}t          dddg|ddgi          }|                    d          }dd|didd|dig}||k    sJ d S )	N_barU   rT   r;   r:   recordsorientr   to_dict)rF   col_underscorerH   dref_ds        rJ   6test_columns_with_leading_underscore_work_with_to_dictzPTestDataFrameConstructors.test_columns_with_leading_underscore_work_with_to_dict   se    aV^aV<==JJiJ((q.!,sA~q.IJzzzzzzrL   c                     d}t          dddg|ddgi          }|                    d          }dd|didd|dig}||k    sJ d S )	N1_br   rU   rT   r;   r:   r   r   r   )rF   col_with_numrH   r   r   s        rJ   Atest_columns_with_leading_number_and_underscore_work_with_to_dictz[TestDataFrameConstructors.test_columns_with_leading_number_and_underscore_work_with_to_dict   se    aV\Aq6:;;JJiJ((q,*S!\1,EFzzzzzzrL   c                 ,   t          j        dd          }t          j        |gt                    }|t          u r|                    dd          }d}t          j        t          |          5   ||d           d d d            d S # 1 swxY w Y   d S )NNaTr`   r<   rU   =Invalid type for timedelta scalar: <class 'numpy.datetime64'>rj   m8[ns])	r>   
datetime64ro   rC   r   r@   rq   rr   	TypeError)rF   frame_or_seriesnatrG   rs   s        rJ   ,test_array_of_dt64_nat_with_td64dtype_raiseszFTestDataFrameConstructors.test_array_of_dt64_nat_with_td64dtype_raises   s    mE4((huF+++i''++a##CM]9C000 	1 	1OCx0000	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1s   .B		BBkindmMc                    |dk    r
d}t           }n	d}t          }t          j        dd                              |                              dd          }|t          u r|d d d	f         } ||t                    }|j        j	        d	         j
        t          k    sJ t          |j        j	        d	                                         d	         |          sJ  | ||          t                    }|j        j	        d	         j
        t          k    sJ t          |j        j	        d	                                         d	         |          sJ  | ||          t          t                              }|j        j	        d	         j
        t          k    sJ t          |j        j	        d	                                         d	         |          sJ |t          u rzd
 |D             } ||t                    }|j        j	        d	         j
        t          k    sJ t          |j        j	        d	                                         d	         |          sJ d S d S )Nr   rv   r   rO   rl   r<   r;   rT   r   c                 ,    g | ]}t          |          S  r    .0xs     rJ   
<listcomp>zXTestDataFrameConstructors.test_datetimelike_values_with_object_dtype.<locals>.<listcomp>   s    +++!F1II+++rL   )r"   r!   r>   r?   viewr@   r    rC   rY   arraysr=   
isinstanceravelr   r   )rF   r   r   r=   scalar_typerG   objserss           rJ   *test_datetimelike_values_with_object_dtypezDTestDataFrameConstructors.test_datetimelike_values_with_object_dtype   sB    3;;E#KKE#Ki&&&++E22::1a@@f$$aaad)Coc000xq!'61111#(/!,2244Q7EEEEE oooc22&AAAxq!'61111#(/!,2244Q7EEEEEoooc22,v:N:NOOOxq!'61111#(/!,2244Q7EEEEEi''++s+++D!/$f555C8?1%+v5555choa06688;[IIIII ('
 JIrL   c                 b   t          t          d          d          }t          t          d          d          }t          |dg          }t          g dg          }t          j        ||           t          |dg          }t          g dg          }t          j        ||           d S )N   rU   r|   r   columns)r    ranger   rD   rE   )rF   r   yr   rI   s        rJ   )test_series_with_name_not_matching_columnzCTestDataFrameConstructors.test_series_with_name_not_matching_column   s    588!$$$588!$$$1qc***R!---
fh///1qc***R!---
fh/////rL   constructorc                      t                      S Nr   r   rL   rJ   <lambda>z"TestDataFrameConstructors.<lambda>   s
    IKK rL   c                       t          d           S r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   s    IdOO rL   c                       t          d          S Nr   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>       IbMM rL   c                       t          g           S r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   r   rL   c                  4    t          d dD                       S )Nc              3      K   | ]}|V  d S r   r   r   _s     rJ   	<genexpr>z5TestDataFrameConstructors.<lambda>.<locals>.<genexpr>   s      __Aa______rL   r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   s    I_____,, rL   c                  :    t          t          d                    S Nr   r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   s    IeAhh'' rL   c                  "    t          d           S Ndatar   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   s    I4((( rL   c                  "    t          d          S )Nr   r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>       I2&&& rL   c                  "    t          g           S r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   r   rL   c                  6    t          d dD                       S )Nc              3      K   | ]}|V  d S r   r   r   s     rJ   r   z5TestDataFrameConstructors.<lambda>.<locals>.<genexpr>   s      ??!A??????rL   r   r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   s    I??r???333 rL   c                  <    t          t          d                    S )Nr   r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   s    I588,,, rL   c                     t                      } |            }t          |j                  dk    sJ t          |j                  dk    sJ t	          j        ||           d S r   )r   rX   rc   r   rD   rE   rF   r   rI   r   s       rJ   test_empty_constructorz0TestDataFrameConstructors.test_empty_constructor   sg    " ;;6<  A%%%%6>""a''''
fh/////rL   c                       t          i           S r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   r   rL   c                  "    t          i           S r   r   r   rL   rJ   r   z"TestDataFrameConstructors.<lambda>   r   rL   c                    t          t          d          t          d                    } |            }t          |j                  dk    sJ t          |j                  dk    sJ t          j        ||d           d S )Nr   rc   r   T)check_index_type)r   r   rX   rc   r   rD   rE   r   s       rJ   #test_empty_constructor_object_indexz=TestDataFrameConstructors.test_empty_constructor_object_index   s     :a==*Q--HHH6<  A%%%%6>""a''''
fhFFFFFFrL   z)emptylike,expected_index,expected_columnsrU   r   rT   c              #      K   | ]}|V  d S r   r   r   s     rJ   r   z#TestDataFrameConstructors.<genexpr>  s      ooQqoooooorL   r   c                 p    t          ||          }t          |          }t          j        ||           d S )Nr   r   rD   rE   )rF   	emptylikeexpected_indexexpected_columnsrI   r   s         rJ   test_emptylike_constructorz4TestDataFrameConstructors.test_emptylike_constructor   s=     >;KLLL9%%
fh/////rL   c                 L    |rdnt           j        }|d         j        |k    sJ d S )Nstringfoo)r>   object_r=   )rF   float_string_frameusing_infer_stringr=   s       rJ   test_constructor_mixedz0TestDataFrameConstructors.test_constructor_mixed  s1    .>BJ!%(.%777777rL   c                 ,   d}t          j        t          |          5  t          dg dit          j                   d d d            n# 1 swxY w Y   t          t	          j        d                    }t	          j        d                                          |d<   d}t          j        t          |          5  t	          j        d          |d	<   d d d            n# 1 swxY w Y   t	          j        d                                          |d
<   d S )Nz!could not convert string to floatrj   r   r   bcr<   )r:   rT   r   z5Expected a 1D array, got an array with shape \(4, 2\)testfoo2)rq   rr   
ValueErrorr   r>   r-   onesr~   )rF   rs   rH   s      rJ   test_constructor_cast_failurez7TestDataFrameConstructors.test_constructor_cast_failure  s~    2]:S111 	@ 	@sOOO,BJ????	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ rwv'' GFOO**,,5	 H]:S111 	) 	)BvJ	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) WV__++--6


s#    A

AA<C  C$'C$c                     t          dgdgdgd          }t          |t          d          }d|d<   |d         d	         dk    sJ d S )
N      ?       @      @)col1col2col3T)r=   copyg      i@r   r   )r   float)rF   orig_dfnew_dfs      rJ   test_constructor_dtype_copyz5TestDataFrameConstructors.test_constructor_dtype_copy$  s\    cUSEC5IIJJ7%d;;;vvq!S((((((rL   c                 6   t          ddgg          }t          ||d         j                  }|rd|j        d<   |j        d         dk    sJ d S t	          j        |          5  d|j        d<   d d d            n# 1 swxY w Y   |j        d         dk    sJ d S )NrU   rT   r   r<   c   r   r   )r   r=   ilocvaluesrD   assert_cow_warning)rF   using_copy_on_writewarn_copy_on_writerH   should_be_views        rJ   ,test_constructor_dtype_nocast_view_dataframezFTestDataFrameConstructors.test_constructor_dtype_nocast_view_dataframe,  s     Ax  "2RU[999 	)(*N%9T?a''''''&'9:: / /,.#D)/ / / / / / / / / / / / / / /9T?b((((((s   $A;;A?A?c                 :   t          ddgddggd          }|sB|s@t          |j        |d         j                  }d|j        d	<   |j        d	         dk    sJ d S t          |j        |d         j                  }|j        j        d         j        j        sJ d S )
NrU   rT   r;   r:   r5   r<   r   a   r  )r   r  r=   r  rY   r   flagsc_contiguous)rF   r[   r  r  rH   r  df2s          rJ   +test_constructor_dtype_nocast_view_2d_arrayzETestDataFrameConstructors.test_constructor_dtype_nocast_view_2d_array9  s     AA'w777" 
	9+> 
	9&ry1DDDN )+N%9T?b(((((( BIRU[999C8?1%+888888rL   zconversion copiesreasonc                     t          j        ddgd          }t          |d          }t          j        |j        |          sJ d S )Nr   r   rC   r<   Fr   r>   ro   r   shares_memoryr  rF   rG   rH   s      rJ   "test_1d_object_array_does_not_copyz<TestDataFrameConstructors.test_1d_object_array_does_not_copyI  sO     hSz222s'''	3///////rL   c                     t          j        ddgddggd          }t          |d          }t          j        |j        |          sJ d S )	Nr   r   r   r   rC   r<   Fr  r  r  s      rJ   "test_2d_object_array_does_not_copyz<TestDataFrameConstructors.test_2d_object_array_does_not_copyQ  sX     hc
S#J/x@@@s'''	3///////rL   c                     t          ddgd dggt                    }|j        d         J |j        d         dk    sJ d S )NrU   2r   r<   rU   r   rV   )r   rC   locrx   s     rJ    test_constructor_dtype_list_dataz:TestDataFrameConstructors.test_constructor_dtype_list_dataY  sP    C4+.f===vd|###vd|s""""""rL   c                    t                      }t          j        d          }t          j        t
          d          5  t          |g           d d d            n# 1 swxY w Y   t          j        t
          d          5  t          |g           d d d            n# 1 swxY w Y   t          dddgi          }t          j        t
          d          5  t          ||g           d d d            d S # 1 swxY w Y   d S )Nr  zshape=\(1, 0, 0\)rj   ArU   rT   zshape=\(2, 2, 1\))r   r>   emptyrq   rr   r   )rF   r   r   s      rJ   "test_constructor_list_of_2d_raisesz<TestDataFrameConstructors.test_constructor_list_of_2d_raises^  s   KKHV]:-ABBB 	 	qcNNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ]:-ABBB 	 	qcNNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 sQFm$$]:-ABBB 	 	q!f	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s5   AA"ABB"%B"C66C:=C:ztyp, adr   r   barr  r{   Cintc                    |dk    rt           }d |D             }n|dk    rt          }d |D             }t          ||          D ]\  }}|j        |k    sJ |                    t          t          ||                               t          |          }t          t           z   }|D ]}||v r|j        |         |k    sJ d S )Nr%  c                     g | ]H}t          j        t           j                            d                               d          |          IS )rT   
   r<   )r>   ro   randomdefault_rngr   r   s     rJ   r   zKTestDataFrameConstructors.test_constructor_mixed_dtypes.<locals>.<listcomp>z  sR       KL..q1188<<AFFF  rL   r   c                     g | ]J}t          j        t           j                            d                               dd          |          KS )rT   r(  )sizer<   )r>   ro   r)  r*  integersr+  s     rJ   r   zKTestDataFrameConstructors.test_constructor_mixed_dtypes.<locals>.<listcomp>  sZ        ..q11::2B:GGqQQQ  rL   )MIXED_INT_DTYPESMIXED_FLOAT_DTYPESzipr=   updatedictr   dtypes)rF   typadr4  r   r   r   rH   s           rJ   test_constructor_mixed_dtypesz7TestDataFrameConstructors.test_constructor_mixed_dtypesl  s    %<<%F PV  FF G^^'F   F
 '' 	  	 DAq7a<<<<<
		$s66**++,,,r]]#&66 	) 	)ABwwy|q((((	) 	)rL   c                    t           j                            d                              d                              t           j                  }t           j                            d                              d                              t           j                  }t          ||d          }|j        |j        j        k    sJ |j        |j	        j        k    sJ d S )NrT   r(  r   r   )
r>   r)  r*  rB   	complex64
complex128r   r=   r   r   rF   r   r   rH   s       rJ   test_constructor_complex_dtypesz9TestDataFrameConstructors.test_constructor_complex_dtypes  s    I!!!$$++B//66r|DDI!!!$$++B//66r}EEQQ''((w"$*$$$$w"$*$$$$$$rL   c                 F   t          ddd gi|          }|                                }t          dddgi          }t          j        ||           |j        d         J t          ddt
          j        gi|          }t          j        |j        d                   sJ d S )Nr  r   r<   FTr  )r   r%   rD   rE   r  r>   rp   isnan)rF   string_dtyperH   r   rI   s        rJ   $test_constructor_dtype_str_na_valuesz>TestDataFrameConstructors.test_constructor_dtype_str_na_values  s    c4[)>>>cE4=122
fh///wt}$$$c26]+<@@@x&&&&&&&rL   c                    |                     d          }t          |j        j                  d d d         |j        _        |j        }t          |          }t          j        |j        t          |j        j                             t          ||          }t          j        |j        t          |j        j                             t          j        |j        |           t          j        t          |                    d d d         }t          ||ddg          }t          ||                              ddg          }t          j        ||           d S )NFrb   r$  r{   r   r   )
to_recordslistr=   namesrc   r   rD   assert_index_equalr   r   r>   r?   rX   reindexrE   )	rF   float_framerecrc   rH   r  rngdf3rI   s	            rJ   test_constructor_recz.TestDataFrameConstructors.test_constructor_rec  s.   $$5$11sy//"5	!s^^
bj%	*@*@AAA5)))
ck5+A+ABBB
ci/// iC!!$$B$'3c
;;;S,,,44c3Z4HH
c8,,,,,rL   c                     t          t          j        dt                    t          j        dt                    d          }|j        j        t          j        k    sJ d S )Nr(  r<   rV   )r   r>   r   boolzerosr  r=   bool_rx   s     rJ   test_constructor_boolz/TestDataFrameConstructors.test_constructor_bool  sR    272T222rx$7O7O7OPPQQy"(******rL   c                    t          j        d t          dd          D             t           j                  }t	          d|i          }|d         j        t           j        k    sJ g d}ddg}t          j        t          |          f|          }||d d <   t	          |          }|d	         j        t           j        k    sJ d S )
Nc                     g | ]}d |z
  S )            r   r   is     rJ   r   zMTestDataFrameConstructors.test_constructor_overflow_int64.<locals>.<listcomp>  s    ;;;519;;;rL   rU   r(  r<   r   ))l   Y2<   )l   FJLW]L*    )l   M:M^ -   )l   8Ma i  )l   r*R3_PvN rX  )uidu8)scorer\  r[  )r>   ro   r   r1   r   r=   rP  rX   )rF   r  r   data_scoresr=   r   	df_crawlss          rJ   test_constructor_overflow_int64z9TestDataFrameConstructors.test_constructor_overflow_int64  s    ;;eArll;;;29MMMC=))c{ BI----
 
 
 0x[))+5999QQQdOO	%222222rL   r  rU  r<   A   l           l        l        c                     |d         }t          |          }|d         j        t          k    sJ |d         d         |k    sJ d S r   )r   r=   rC   rF   r  rd   r   s       rJ   test_constructor_int_overflowz7TestDataFrameConstructors.test_constructor_int_overflow  sP     q	6""ay&((((ay|u$$$$$$rL   c                     |d         }t          |          }|d         j        |j        k    sJ |d         d         |k    sJ d S r   r   r=   rc  s       rJ   test_constructor_numpy_uintsz6TestDataFrameConstructors.test_constructor_numpy_uints  sR     q	6""ay%+----ay|u$$$$$$rL   c           	      P   d}t          t          |                    }t          j                            d                              |           d |D             }t          t          t          |dgg|z                                }|t          |j	                  k    sJ d S )Nd   rT   c                     g | ]}d |d	S )r  r   r   rV  s     rJ   r   zJTestDataFrameConstructors.test_constructor_ordereddict.<locals>.<listcomp>  s     ,,,!IIII,,,rL   r   )
rE  r   r>   r)  r*  shuffler   r   r1  r   )rF   nitemsnumsrI   rH   s        rJ   test_constructor_ordereddictz6TestDataFrameConstructors.test_constructor_ordereddict  s    E&MM""
	a  ((...,,t,,,{3x1##@#@AABB4
++++++++rL   c                    t          t          j        dt          j                  t	          dd                    }|dd          }t          ||d          }t          |          dk    sJ t          |          dk    sJ t          j        |d	         |	                    d	                     t          t          j
        t          j        gdz  |j        g          |j        d
          }t          j        ||d
                    t          ||dg d          }t          |          t          |          k    sJ d	|vsJ t          |d                                                   sJ t          t                                dk    sJ d}t!          j        t$          |          5  t          dddg dd           d d d            d S # 1 swxY w Y   d S )N   r<   
2020-01-01rR   rb   r   r   r      r   r   rc   rn   )r   r   col4r   r   r   <Mixing dicts with non-Series may lead to ambiguous ordering.rj   r   r   r9  r   r  r{   )r    r>   r?   r-   r$   r   rX   rD   r   renameconcatenaterp   r  rc   r%   allrq   rr   r   )rF   datetime_seriesdatetime_series_shortframeexprs   s         rJ   test_constructor_dictz/TestDataFrameConstructors.test_constructor_dict  se    Ib
+++:lTV3W3W3W
 
 
 !0 3?<QRRSS ?##r))))())R////
uV}o.D.DV.L.LMMMNRVHqL*?*FGHH!'
 
 

 	sE&M222$.CDD,,,
 
 

 5zzS!6777777U""""E&M""&&((((( 9;;1$$$$ M]:S111 	I 	I#C00GGHHH	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	Is   1GGGc                     t          ddddi          }t          j        |j        t	          ddg                     d S )Nr  rU   rT   1r  r  r  )r   rD   rG  rc   r   rF   r~  s     rJ   test_constructor_dict_length1z7TestDataFrameConstructors.test_constructor_dict_length1$  sC    3aa 0 0122
ek5#s+<+<=====rL   c                 `    t          g d          }t          i |          }|j        |u sJ d S )Nr   rU   rT   rb   )r   r   rc   rF   r   r~  s      rJ    test_constructor_dict_with_indexz:TestDataFrameConstructors.test_constructor_dict_with_index)  s>    III"C((({c!!!!!!rL   c                     t          g d          }t          i ||          }|j        |u sJ |j        |u sJ t	          |j                  dk    sJ d S )Nr  r   r;   )r   r   rc   r   rX   _seriesr  s      rJ   ,test_constructor_dict_with_index_and_columnszFTestDataFrameConstructors.test_constructor_dict_with_index_and_columns/  sn    III"C555{c!!!!}####5=!!Q&&&&&&rL   c                     t          g g dddg          }t          j        |j        t	          d          d           d S )Nrx  r  r{   r   r   Texact)r   rD   rG  rc   r   r  s     rJ   $test_constructor_dict_of_empty_listsz>TestDataFrameConstructors.test_constructor_dict_of_empty_lists7  sF    ,,sCjAAA
ek:a==EEEEEErL   c                     t          dd idg          }t          dd gidg          }|                    dd          J |                    dd          J t          j        ||           d S )Nr   r   rb   )r   
_get_valuerD   rE   )rF   
frame_noneframe_none_lists      rJ   test_constructor_dict_with_nonez9TestDataFrameConstructors.test_constructor_dict_with_none<  s     T{1#666
#S4&M!===$$Q,,444))!S11999
j/:::::rL   c                 "   d}t          j        t          |          5  t          ddi           d d d            n# 1 swxY w Y   t          j        t          |          5  t          ddidg           d d d            d S # 1 swxY w Y   d S )N2If using all scalar values, you must pass an indexrj   r   gffffff?r   rq   rr   r   r   rF   rs   s     rJ   test_constructor_dict_errorsz6TestDataFrameConstructors.test_constructor_dict_errorsE  s    C]:S111 	" 	"sCj!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" ]:S111 	1 	1sCj3%0000	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1s!   <A A "BBBscalarNDc                 z    t          d|idg          }t          dg          }t          j        ||           d S )Nr   r   r   r   )rF   r  r   rI   s       rJ   %test_constructor_invalid_items_unusedz?TestDataFrameConstructors.test_constructor_invalid_items_unusedO  sG     C=3%888cU+++
fh/////rL   rd   rp   c                 >   d|dgd|gddgddgddggfdt          d          D             }t          |                              d                              dd	          }t          t          j        d
d                              dd                    }t          j        ||           t          |                              dd	          }t          j        ||           t          |          }t          j        ||           d S )NrU   r;   r   r   r:   rT   r   c                 L    i | ] }|         t          |                    !S rb   r   r   r   colsr   r  s     rJ   
<dictcomp>zKTestDataFrameConstructors.test_constructor_dict_nan_key.<locals>.<dictcomp>\  0    HHH!Qq	555HHHrL   axisrO   r5   r<   r   rb   )r   r   sort_valuesr>   r?   r@   rD   rE   rF   rd   r   r   rI   r  r   r  s        @@@rJ   test_constructor_dict_nan_keyz7TestDataFrameConstructors.test_constructor_dict_nan_keyV  s8    5!}Ela&1a&1a&)HHHHHHuQxxHHH4,,Q//;;Ca;HHIaw'''//155S$
 
 
 	fh///4s+++77!7DD
fh///4sD999
fh/////rL   c                    t          d|dfd|fg          t          d|f|dfg          ddgdd	gdd
ggfdt          d          D             }t          |                              d                              d|fd          }t          t	          j        dd                              dd                    }t          j        ||           t          |                              d|fd          }t          j        ||           t          |          }t          j        ||           d S )N)            r   rT   r   r;   rU   r:   r   c                 L    i | ] }|         t          |                    !S r  r   r  s     rJ   r  zQTestDataFrameConstructors.test_constructor_dict_nan_tuple_key.<locals>.<dictcomp>o  r  rL   r  rO   r5   r<   r   rb   )	r   r   r   r  r>   r?   r@   rD   rE   r  s        @@@rJ   #test_constructor_dict_nan_tuple_keyz=TestDataFrameConstructors.test_constructor_dict_nan_tuple_keyi  sc    hb%[9::c5\E1:.//a&1a&1a&)HHHHHHuQxxHHH4,,X66BBC<VWBXXIaw'''//155S$
 
 
 	fh///4s+++77e17MM
fh///4sD999
fh/////rL   c                 &   t          t          j        dt          j                  t	          dd                    }|d d         }||d}t          |          }t          |t          d	          
          }t          j        ||           d S )Nr(  r<   rq  rr  rb   r   r   r   r   bar   r   )	r    r>   r?   r-   r$   r   rE  rD   rE   )rF   r|  r}  r   r~  rI   s         rJ   %test_constructor_dict_order_insertionz?TestDataFrameConstructors.test_constructor_dict_order_insertion|  s     Ib
+++:lTV3W3W3W
 
 
 !0 3 (o>>q!!!!T$ZZ888
eX.....rL   c                     t          t          j        ddgdddgit          j        dg          }t          ddgddggt          j        dg          }t          j        ||           d S )NrU   rT   r;   r   )r   r>   rp   rD   rE   rF   r   rI   s      rJ   )test_constructor_dict_nan_key_and_columnszCTestDataFrameConstructors.test_constructor_dict_nan_key_and_columns  sk    BFQFA1v6LLLq!fq!f-{CCC
fh/////rL   c                    g d}t          j        |          }t          ||          }t          |          j                                                                        sJ g d}t          j        |          }t          ||          }t          |          j                                                                        sJ d S )N)rT   r;   r;   r;   r  r   )r  r  r  )r   from_tuplesr   r%   r  r   r{  )rF   tuplesmirH   s       rJ   test_constructor_multi_indexz6TestDataFrameConstructors.test_constructor_multi_index  s     *))#F++R,,,Bxx$$&&**,,,,,)))#F++R,,,Bxx$$&&**,,,,,,,rL   c                    t          dggdggddg          }t          ddgt          ddgd          t          dggdgg                    }t          j        ||           t          dggdggddgg          }t          ddgt          ddggddgg          t          dggdgg                    }t          j        ||           d S )	NrU   rT   r   rc   r5   r<   r   )levelscodesr   )r   r   r   rD   rE   rF   rH   rI   s      rJ   test_constructor_2d_indexz3TestDataFrameConstructors.test_constructor_2d_index  s    useAq6:::FAg...seQC5999
 
 

 	b(+++useQF8<<<FaVHaVH===seQC5999
 
 

 	b(+++++rL   c           	         d}t          j        t          |          5  t          t	          j        d          dg           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          ddd	g d
d           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          t	          j        d                              d          g dt          dd                     d d d            n# 1 swxY w Y   t	          j	        g dg          }d}t          j        t          |          5  t          dgt          d          |           d d d            n# 1 swxY w Y   t	          j	        g d          }d}t          j        t          |          5  t          dgt          d          |           d d d            n# 1 swxY w Y   t          j        t          d          5  t          t	          j        d          g ddg           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          t          j                            d                              d          g ddg           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          t          j                            d                              d          d d!gddg           d d d            n# 1 swxY w Y   d"}t          j        t          |          5  t          t          d#          t          d#d$          fd%&           d d d            n# 1 swxY w Y   d'}t          j        t          |          5  t          d(d)d	           d d d            d S # 1 swxY w Y   d S )*Nz)Empty data passed with indices specified.rj   r   rU   rb   rw  r   r   r9  r   rx  z:Shape of passed values is \(4, 3\), indices imply \(3, 3\)r9   )r:   r;   r   r"  baz
2000-01-01r;   rr  r  r:   r   rO   z:Shape of passed values is \(1, 3\), indices imply \(1, 4\)r:   rc   r   r   z:Shape of passed values is \(3, 1\), indices imply \(1, 4\)Must pass 2-d inputr;   r;   r;   r#  :Shape of passed values is \(2, 3\), indices imply \(1, 3\)rT   r  :Shape of passed values is \(2, 3\), indices imply \(2, 2\)r  r{   z,2 columns passed, passed data had 10 columnsr(     )r   twosr   r  FT)rq   rr   r   r   r>   r   r?   r@   r$   ro   r   rP  r)  r*  )rF   rs   rG   s      rJ   test_constructor_error_msgsz5TestDataFrameConstructors.test_constructor_error_msgs  s   9]:S111 	. 	.bhqkk!----	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. M]:S111 	I 	I#C00GGHHH	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I 	I L]:S111 	 		"%%f----- q999   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 h			{##K]:S111 	= 	=QCq<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= hyyy!!K]:S111 	= 	=QCq<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= ]:-BCCC 	O 	Obhy))???1#NNNN	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O L]:S111 	 		%%a((//77'c   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 L]:S111 	 		%%a((//77c
!f   	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 =]:S111 	L 	LuRyy%B--0:JKKKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L C]:S111 	/ 	/E--...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/s   %AAA7BB"BA	DDD!FFF!G//G36G3(I		II1AKK
K+AL>>MM&/N!!N%(N%	O))O-0O-c                     |d t          d          D                        |d t          d          D                       d}t          |          }t          d |                                D                       }t          j        ||            ||                                          }t          |          }t          j        ||           d S )Nc              3   $   K   | ]}|d |z  fV  dS )g      $@Nr   r   s     rJ   r   zKTestDataFrameConstructors.test_constructor_subclass_dict.<locals>.<genexpr>  *      !C!CA1dQh-!C!C!C!C!C!CrL   r(  c              3   $   K   | ]}|d |z  fV  dS )g      4@Nr   r   s     rJ   r   zKTestDataFrameConstructors.test_constructor_subclass_dict.<locals>.<genexpr>  r  rL   rs  c                 X    i | ]'\  }}|t          |                                          (S r   )r3  items)r   colvals      rJ   r  zLTestDataFrameConstructors.test_constructor_subclass_dict.<locals>.<dictcomp>  s.    OOOhc33SYY[[ 1 1OOOrL   )r   r   r  rD   rE   )rF   dict_subclassr   rH   refdfs        rJ   test_constructor_subclass_dictz8TestDataFrameConstructors.test_constructor_subclass_dict  s     "M!C!Cr!C!C!CCC!M!C!Cr!C!C!CCC
 
 t__OO$**,,OOOPP
eR(((}TZZ\\**t__
eR(((((rL   c                    i }t           j        |j        d |j        d         df<   |                                D ]E\  }}t          t                    }|                    |                                           |||<   Ft          |          }|
                    |j                  }t          j        ||           d S )Nr(  r{   rb   )r>   rp   r  rc   r  r   r3  r2  r   r   rH  rD   rE   )rF   rI  r   kvdctr~  rI   s           rJ   test_constructor_defaultdictz6TestDataFrameConstructors.test_constructor_defaultdict  s    8:/++B//45%%'' 	 	DAqd##CJJqyy{{###DGG$=={'8=99
k844444rL   c                     t          j        g dg          }t          dgdgdgdgdg d          }t          j        |j        |           d S )N)      @r   r   r   r  r   r   r   )r   r   r   r   r   )r>   ro   r   rD   assert_numpy_array_equalr  rF   rI   rH   s      rJ   test_constructor_dict_blockz5TestDataFrameConstructors.test_constructor_dict_block  sl    8111233%se3%se<<(((
 
 
 	#BIx88888rL   c                    dddddddd}t          |t          	          }t          |          d
k    sJ |d         j        t          j        k    sJ |d         j        t          j        k    sJ t          |          }t          |          d
k    sJ |s|d         j        t          j        k    snnJ |d         j        t          j        k    sJ d S )NrU   rT   r  r  r  3)r  r  r  rx  r<   r;   r{   r  )r   r   rX   r=   r>   r-   r   )rF   r   	test_datar~  s       rJ   test_constructor_dict_castz4TestDataFrameConstructors.test_constructor_dict_cast  s     !**s31O1OPP	)51115zzQSz2:----Sz2:----)$$5zzQ5GUuSz2:------Sz2:------rL   c           	         t          t          t          d          d t          d          D                                 t          t          t          d          t          j                            d                              d                              d}t          j        t          d          5  t          |t                     d d d            d S # 1 swxY w Y   d S )	Nr  c                     g | ]}d | S )word_r   rV  s     rJ   r   zITestDataFrameConstructors.test_constructor_dict_cast2.<locals>.<listcomp>  s    %E%E%Eakakk%E%E%ErL      rT   rx  zcould not convert stringrj   r<   )r3  r1  r   r>   r)  r*  standard_normalrq   rr   r   r   r   )rF   r  s     rJ   test_constructor_dict_cast2z5TestDataFrameConstructors.test_constructor_dict_cast2  s    c%))%E%E599%E%E%EFFGGc%))RY%:%:1%=%=%M%Mb%Q%QRRSS
 
	 ]:-GHHH 	. 	.iu----	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	.s   8CC #C c                     ddt           j        di}t          |          }t          |d         d         t                    sJ d S )NCol1zA String)Row1Row2r  )r>   rp   r   r   r   )rF   r   rH   s      rJ   !test_constructor_dict_dont_upcastz;TestDataFrameConstructors.test_constructor_dict_dont_upcast$  sF    j"&99:q\\"V*V,e4444444rL   c                     t          ddgddggddgddg          }t          |d         d         t                    sJ d S )NrU   rT   r   r   r   )r   r   r%  )rF   dms     rJ   "test_constructor_dict_dont_upcast2z<TestDataFrameConstructors.test_constructor_dict_dont_upcast2)  sO    Ac
+Aq6Aq6JJJ"Q%(C(((((((rL   c                     ddd}t          |          }t          d |                                D                       }t          j        ||d           d S )NrU   rT   r;   r  r9  c                 4    i | ]\  }}|t          |          S r   )rE  )r   r  r  s      rJ   r  zMTestDataFrameConstructors.test_constructor_dict_of_tuples.<locals>.<dictcomp>2  s$    BBBTQaaBBBrL   Fcheck_dtype)r   r  rD   rE   rF   r   r   rI   s       rJ   test_constructor_dict_of_tuplesz9TestDataFrameConstructors.test_constructor_dict_of_tuples-  s\    Y//4BBTZZ\\BBBCC
fhEBBBBBBrL   c                     t          d          t          dd          d}t          |          }t          g dg dd          }t          j        ||           d S )Nr;   rO   r9  r  )r;   r:   r   r   r   rD   rE   r   s       rJ   test_constructor_dict_of_rangesz9TestDataFrameConstructors.test_constructor_dict_of_ranges5  s^    1XXE!QKK004999999==>>
fh/////rL   c                     t          t          d                    t          t          d                    d}t          |          }t          g dg dd          }t	          j        ||           d S )Nr;   r9  r  rT   rU   r   )iterr   reversedr   rD   rE   r   s       rJ   "test_constructor_dict_of_iteratorsz<TestDataFrameConstructors.test_constructor_dict_of_iterators=  sj    %((^^(588*<*<==4999999==>>
fh/////rL   c                     d t          d          D             d t          t          d                    D             d}t          |          }t          g dg dd          }t          j        ||           d S )Nc              3      K   | ]}|V  d S r   r   rV  s     rJ   r   zPTestDataFrameConstructors.test_constructor_dict_of_generators.<locals>.<genexpr>G  s"      ,,Aa,,,,,,rL   r;   c              3      K   | ]}|V  d S r   r   rV  s     rJ   r   zPTestDataFrameConstructors.test_constructor_dict_of_generators.<locals>.<genexpr>G  s"      3R3R!A3R3R3R3R3R3RrL   r9  r  r  )r   r  r   rD   rE   r   s       rJ   #test_constructor_dict_of_generatorsz=TestDataFrameConstructors.test_constructor_dict_of_generatorsE  s    ,,%((,,,3R3Rxa?Q?Q3R3R3RSS4999999==>>
fh/////rL   c                    dddddddddd	d
dd}t          |                                          }t          |          }t          d |D             t          j        d |D                                 j        }t          j        |j                  |_        t          j        ||           ddddd|d<   |	                    dd|d         f           t          d |D             t          d |D             d                    j        }t          |j        d          |_        t          |          }|                    |j        |j                  }t          j        ||           d S )Nr   rU   rT   )rW  rW  rW  jr  rW  rO   r   r:         	   ))r   r   r  )r   r   c                     g | ]
}|d          S rU   r   r   s     rJ   r   zNTestDataFrameConstructors.test_constructor_dict_multiindex.<locals>.<listcomp>U      aQqTrL   c                     g | ]
}|d          S r   r   r   s     rJ   r   zNTestDataFrameConstructors.test_constructor_dict_multiindex.<locals>.<listcomp>U  s    =O=O=Oqad=O=O=OrL   rb   g     ^@o   )r   r  r  r  zc                     g | ]
}|d          S r  r   r   s     rJ   r   zNTestDataFrameConstructors.test_constructor_dict_multiindex.<locals>.<listcomp>`  r  rL   c                     g | ]
}|d          S r  r   r   s     rJ   r   zNTestDataFrameConstructors.test_constructor_dict_multiindex.<locals>.<listcomp>`  s    ,>,>,>aQqT,>,>,>rL   F)tupleize_colsr  )sortedr  r   r   r  Trc   rD   rE   insertr   rH  r   )rF   r   _drH   rI   s        rJ    test_constructor_dict_multiindexz:TestDataFrameConstructors.test_constructor_dict_multiindexL  s   %&A1EE%&A1EE%&A1EE
 

 AGGIIq\\2j&<=O=OB=O=O=O&P&P
 
 

 	 $/??
	
 	
 	

 #3CPP#
		!c1S6]###2e,>,>2,>,>,>e&T&T&T
 
 

 	 x~UCCCq\\ZZ 0ZGG
b(+++++rL   c           
        	 g d		fd} |t           j                  } |d           } |t                    }t          dd d d dd dd d dd d dd dd d d ddgd	 	D             
          }t          |          }t          |          }t          |          }t	          j        ||           t	          j        ||           t	          j        ||           d S )N)z
1984-02-19z
1988-11-06z
1989-12-03z
1990-03-15c                 <      fdt                    D             S )Nc                 8    i | ]\  }}| |          d |z  iS rT   r   )r   rW  sr   s      rJ   r  ziTestDataFrameConstructors.test_constructor_dict_datetime64_index.<locals>.create_data.<locals>.<dictcomp>l  s0    SSS41aAAA.SSSrL   )	enumerate)r   dates_as_strs   `rJ   create_datazUTestDataFrameConstructors.test_constructor_dict_datetime64_index.<locals>.create_datak  s&    SSSS9\;R;RSSSSrL   c                 ,    t          j        | d          S )Nz%Y-%m-%d)r
   strptimer   s    rJ   r   zRTestDataFrameConstructors.test_constructor_dict_datetime64_index.<locals>.<lambda>o  s    h.?:.N.N rL   r   r   rU   rT   r;   rT   r:   rO   c                 ,    g | ]}t          |          S r   )r"   )r   ra   s     rJ   r   zTTestDataFrameConstructors.test_constructor_dict_datetime64_index.<locals>.<listcomp>y  s    888R9R==888rL   rb   )r>   r   r"   r   rD   rE   )
rF   r,  data_datetime64data_datetimedata_TimestamprI   result_datetime64result_datetimeresult_Timestampr+  s
            @rJ   &test_constructor_dict_datetime64_indexz@TestDataFrameConstructors.test_constructor_dict_datetime64_indexg  s5   OOO	T 	T 	T 	T 	T &+bm44#$N$NOO$Y//$4D11Q4D11TaD11Tdq11	 98<888
 
 
 &o66#M22$^44
/:::
ox888
.99999rL   z
klass,namec                 ,    t          j        | d          S Nr  )r>   timedelta64r/  s    rJ   r   z"TestDataFrameConstructors.<lambda>  s    r~a-- rL   r;  c                 "    t          |           S )N)days)r   r/  s    rJ   r   z"TestDataFrameConstructors.<lambda>  s    ya((( rL   pytimedeltac                 "    t          | d          S r:  r!   r/  s    rJ   r   z"TestDataFrameConstructors.<lambda>  s    yC(( rL   zTimedelta[ns]c                 H    t          | d                              d          S )Nr  r)  )r!   rf   r/  s    rJ   r   z"TestDataFrameConstructors.<lambda>  s    yC((0055 rL   zTimedelta[s]c           
          g d}fdt          |          D             }t          dd d d dd dd d dd d dd dd d d ddgd |D             	          }t          |          }t          j        ||           d S )
NrU   rT   r;   r:   c                 8    i | ]\  }}| |          d |z  iS r(  r   )r   rW  r)  klasss      rJ   r  zUTestDataFrameConstructors.test_constructor_dict_timedelta64_index.<locals>.<dictcomp>  s0    FFFAEE!HHa!e$FFFrL   r   r0  rT   r:   rO   c                 .    g | ]}t          |d           S )r  r@  )r   tds     rJ   r   zUTestDataFrameConstructors.test_constructor_dict_timedelta64_index.<locals>.<listcomp>  s"    :::"9R%%:::rL   rb   )r*  r   rD   rE   )rF   rE  rn   	td_as_intr   rI   r   s    `     rJ   'test_constructor_dict_timedelta64_indexzATestDataFrameConstructors.test_constructor_dict_timedelta64_index  s     !LL	FFFF91E1EFFF$4D11Q4D11TaD11Tdq11	 ;:	:::
 
 
 4
fh/////rL   c                    t          j        g dd          }t          j        g dd          }t          ||d          }|d         j        |j        k    sJ |d         j        |j        k    sJ t          |                    t
                                                    |                    t
                                                    d          }|d         j        |j        k    sJ |d         j        |j        k    sJ d S )	N)z2012-01r   z2012-04r   freq)z
2012-02-01z
2012-03-01r   r  r9  r   r   )pdPeriodIndexr   r=   rB   rC   r~   r<  s       rJ   test_constructor_period_dictz6TestDataFrameConstructors.test_constructor_period_dict  s    N888sCCCN>>>SIIIQQ''((#w}''''#w}'''' QXXf--4466QXXf=M=M=T=T=V=VWWXX#w}''''#w}''''''rL   c                     |\  }}t          d|idg          }|d         j        |k    sJ t          dgdg|          }t          j        ||           d S )Nr   r   rb   r  )r   r=   rD   rE   )rF   ea_scalar_and_dtype	ea_scalarea_dtyperH   rI   s         rJ   &test_constructor_dict_extension_scalarz@TestDataFrameConstructors.test_constructor_dict_extension_scalar  sm    1	8Y's333#w}((((A3IFFF
b(+++++rL   z
data,dtypez2020-01r   )leftrightr5   rV  z
2011-01-01
US/EasternrS   r)  )unitrS   c                     t          ddgddg|          }|d         j        |k    sJ |d         j        |k    sJ t          j        |gdz  |          }t          ||d          }t	          j        ||           d S )	Nr   rU   r   r   r  rT   r<   r9  )r   r=   rM  ro   rD   rE   )rF   r   r=   rH   rG   rI   s         rJ   &test_constructor_extension_scalar_dataz@TestDataFrameConstructors.test_constructor_extension_scalar_data  s     aVc3ZdCCC#w}%%%%#w}%%%%hvz///3S1122
b(+++++rL   c                 b   t          j        dd          }t          t          j                            d                              d          |          }i }|j        D ]9}|j        D ]/}|	                    ||          |
                    |i           |<   0:t          ||          }t          j        ||           i }|j        D ]9}|j        D ]/}|	                    ||          |
                    |i           |<   0:t          ||          j        }t          j        ||           d S )Nz1/1/2000r   rr  rT   r(  r   r   rb   )rM  period_ranger   r>   r)  r*  r  r   rc   r  
setdefaultrD   rE   r!  )rF   rK  rH   r   r  rowr   s          rJ   "test_nested_dict_frame_constructorz<TestDataFrameConstructors.test_nested_dict_frame_constructor  sR   oj!444ry,,Q//??HHRUVVV: 	H 	HCx H H02c30G0GR((--H 4---
fb))): 	H 	HCx H H02c30G0GR((--H 4s+++-
fb)))))rL   c                 V    |dt                     }t          |g dddg          }t          |j                  dk    sJ t          |j                  dk    sJ t           |d          d	gg d
          }t          |j                  dk    sJ t          |j                  dk    sJ |t
          j        urXd}t          j        t          |          5  t          |g dddgt
          j
                   d d d            n# 1 swxY w Y   d S t          |g dddgt
          j
                  }|j        j        t
          j
        k    sJ d}t          j        t          |          5  t          |g ddg           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          |d	dgddg           d d d            n# 1 swxY w Y   t          j        t          d          5  t           |d          g ddg           d d d            n# 1 swxY w Y   t          |          }t          j        |j        t!          t#          d                    d           t          j        |j        t!          t#          d                    d           t          |ddg          }t          j        |j        t!          t#          d                    d           t          |g d          }t          j        |j        t!          t#          d                    d           t           |d                    }t          |j                  dk    sJ t           |d                    }t          |j                  dk    sJ d S )Nr  r<   r#  rU   rT   r  r;   )r;   r  r  ri   rj   r   rc   r=   r  r  r{   r  r  Tr  rb   r   )r   r;   r   )r;   r   )r   r   rX   rc   r   r>   r   rq   rr   r   r5   r  r=   r   rD   rG  r   r   )rF   r   matr~  rs   s        rJ   _check_basic_constructorz2TestDataFrameConstructors._check_basic_constructor  s    eF%(((#q!fEEE5;1$$$$5=!!Q&&&& %%++uIIIFFF5;1$$$$5=!!Q&&&&NC1=== V V#q!fBHUUUUV V V V V V V V V V V V V V VF___QF"(  E <%1111 L]:S111 	? 	?c???1#>>>>	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?K]:S111 	= 	=cC:aV<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= ]:-BCCC 	L 	LeeI&&sKKKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L #
ek5q??$GGGG
emU588__DIIII#aV,,,
emU588__DIIII#777
ek5q??$GGGG %%--((5;1$$$$%%--((5=!!Q&&&&&&sH   "DDD/FFF9GG #G H--H14H1c                     |                      t          j                   t          ddgddgdg          }t	          |          dk    sJ d S )Nr   r"  r   rU   r  r   rT   )re  r>   r   r   rX   r  s     rJ   test_constructor_ndarrayz2TestDataFrameConstructors.test_constructor_ndarray  sM    %%bg...5%.AFFF5zzQrL   c                    |                      t          j                   t          j        dt                    }d|d<   d|d<   t	          |g ddd	g
          }d|d         d         k    sJ d|d         d	         k    sJ t          j        dt                    }t	          |g ddd	g
          }t          j        t          j        ||k                         sJ d S )Nr  r<   r   r  r   rU   rT   r#  rU   rT   r  r  r$  )re  r   
masked_allr   r   r>   r{  asarray)rF   rd  r~  s      rJ   test_constructor_maskedarrayz6TestDataFrameConstructors.test_constructor_maskedarray  s    %%bm444 mF%000D	D	#q!fEEEeCjm####eCjm#### mF%000#q!fEEEvrz%5.1112222222rL   z7ignore:elementwise comparison failed:DeprecationWarningc                 V   t          j        dt                    }t          |g dddg          }t	          |j                  dk    sJ t	          |j                  dk    sJ t          j        t          j	        ||k                         sJ t          |g dddgt          j
                  }|j        j        t          j
        k    sJ t          j        |          }d|d	<   d|d
<   t          |g dddg          }d|d         d         k    sJ d|d         d         k    sJ t          j        dd          }t          |g dddg          }t	          |j                  dk    sJ t	          |j                  dk    sJ t          |          j                                        sJ d}t          j        t"          |          5  t          |g dddgt          j                   d d d            n# 1 swxY w Y   t          j        |          }d|d	<   d|d
<   t          |g dddg          }d|d                             d          d         k    sJ d|d                             d          d         k    sJ t          j        dt(                    }t          |g dddg          }t	          |j                  dk    sJ t	          |j                  dk    sJ t          j        t          j	        ||k                         sJ t          |g dddgt*                    }|j        j        t*          k    sJ t          j        |          }d|d	<   d|d
<   t          |g dddg          }|d         d         du sJ |d         d         du sJ d S )Nr  r<   r#  rU   rT   r  r;   rc  r  ri  r  r$  rv   z8datetime64\[ns\] values and dtype=int64 is not supportedrj   rl   TF)r   rj  r%  r   rX   rc   r   r>   r{  rk  r-   r  r=   r   r%   rq   rr   r   r5   rB   rO  rC   )rF   rd  r~  mat2rs   s        rJ   %test_constructor_maskedarray_nonfloatz?TestDataFrameConstructors.test_constructor_maskedarray_nonfloat/  s.   
 mF#...#q!fEEE5;1$$$$5=!!Q&&&&vrz%5.11122222 #q!fBJWWW|!RZ//// ws||T
T
$1vFFFE#JqM!!!!E#JqM!!!! mF(333#q!fEEE5;1$$$$5=!!Q&&&&E{{!%%''''' J]9C000 	R 	Rc???1a&QQQQ	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R 	R ws||T
T
$1vFFFE#J%%d++A.....E#J%%d++A..... mF$///#q!fEEE5;1$$$$5=!!Q&&&&vrz%5.11122222 #q!fFSSS|!V++++ ws||T
T
$1vFFFSz!}$$$$Sz!}%%%%%%s   "G??HHc                 B   t          j        dt                                                    }t	          |ddgddg          }t	          t
          j        t
          j        gt
          j        t
          j        gdddgddgt          	          }t          j        ||           t          j	        dt                                                    }t	          |ddgddg          }t	          d
d
gd
d
gdddgddgt          	          }t          j        ||           d S )N)rT   rT   r<   r  r{   rU   rT   r  rx  rc  r   )
r   rj  r   harden_maskr   r>   rp   rD   rE   r   )rF   mat_hardr   rI   s       rJ   %test_constructor_maskedarray_hardenedz?TestDataFrameConstructors.test_constructor_maskedarray_hardeneds  s$   =u555AACC8c3Z1vFFF626""&"&)9::#Ja&	
 
 
 	fh///76///;;==8c3Z1vFFF*C:..#Ja&	
 
 
 	fh/////rL   c                 d   t           j                            t           j                            dddg          dgdz            }|                    t
          j                  }t          j        t          d          5  t          |t                     d d d            d S # 1 swxY w Y   d S )	Nr   )r	   <f8)priceru  r<   F)maskzPass \{name: data\[name\]rj   )r>   r   ro   rP  r   r   	mrecarrayrq   rr   r   r   r%  rF   r   s     rJ   %test_constructor_maskedrecarray_dtypez?TestDataFrameConstructors.test_constructor_maskedrecarray_dtype  s    u{{EKK/3C!DKEEUGVWK  
 
 yy+,,]9,HIII 	' 	'd#&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	's   B%%B),B)c                 J    t          g           }|j        j        dk    sJ d S )Nrb   r  )r   r  shaperx   s     rJ   test_constructor_corner_shapez7TestDataFrameConstructors.test_constructor_corner_shape  s-    R   y&((((((rL   z%data, index, columns, dtype, expectedr(  r   r   r-   r   c                 N    t          ||||          }|j        j        |k    sJ d S r   )r   r  r=   )rF   r   rc   r   r=   rI   rH   s          rJ   test_constructor_dtypez0TestDataFrameConstructors.test_constructor_dtype  s2     tUGU33y(******rL   zdata,input_dtype,expected_dtype)TFNbooleanr   r   NFloat64)rU   rT   NInt64r   r   c                 b    t          d|i|          }|d         j         |            k    sJ d S )Nr   r<   rf  )rF   r   input_dtypeexpected_dtyperH   s        rJ   0test_constructor_dtype_nullable_extension_arrayszJTestDataFrameConstructors.test_constructor_dtype_nullable_extension_arrays  s?     T{+666#w} 0 0000000rL   c                    dddddd}t          |t          j        d                    }|d	         j        t          j        k    sJ |d
         j        t          j        k    sJ |d         j        t          j        k    sJ |d         j        t          j        k    sJ |s|d         j        t          j        k    snd S J d S )NrU   Tr   y              @r   )r%  rO  r   complexrC   r(  rb   r%  rO  r   r  rC   )	r   r>   r?   r=   r5   rQ  r-   r;  r   )rF   r   r   rH   s       rJ   !test_constructor_scalar_inferencez;TestDataFrameConstructors.test_constructor_scalar_inference  s    $uUUt29R==111%y"(****&z28++++'{ BJ....)}"bm33337IWr(|!RZ/////////rL   c                    t          t          j                            d                              d          dd          }t          |d         j        dgdz  d          }t          j        ||           t          j	        t          d          5  t          ddd           d d d            d S # 1 swxY w Y   d S )	NrT   r(  Tr9  r   zmust pass an indexrj   F)r   r>   r)  r*  r  r  rD   rE   rq   rr   r   )rF   rH   r  s      rJ   #test_constructor_arrays_and_scalarsz=TestDataFrameConstructors.test_constructor_arrays_and_scalars  s    RY22155EEbIIPTUUVVbgnD6B;??@@
b#&&&]:-ABBB 	/ 	/E--...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/s   B44B8;B8c                     t          |          }t          j        ||           t          |t          j                  }|j        j        t          j        k    sJ d S Nr<   )r   rD   rE   r>   r5   r  r=   )rF   rI  rH   	df_casteds       rJ   test_constructor_DataFramez4TestDataFrameConstructors.test_constructor_DataFrame  sU    {##
b+...k:::	%111111rL   c                     t          t                      d          }t          g d          }t          j        ||           d S )NrC   r<   r   )rF   actualrI   s      rJ    test_constructor_empty_dataframez:TestDataFrameConstructors.test_constructor_empty_dataframe  sC    9;;h777Rx000
fh/////rL   c                 T   t           j                            d                              d          }t	          |dgt          j        d                    }|j        j        dk    sJ t           j                            d                              d          }t	          |          }|j        j        dk    sJ |j        j        dk    sJ t	          ddgt          j        d                    }|j        j        dk    sJ t	          ddg          }|j        j        d	k    sJ t	          t          j        d          
          }|j        j        dk    sJ t          j	        ddgt                                        dd          }d}t          j        t          |          5  t	          |ddgdgt                     d d d            n# 1 swxY w Y   t	          t	          |j                            }t#          j        ||           t	          t          j        dt(                    t          j        dt           j                  dt          j        d          
          }t-          |j                  dk    sJ |j        j        t           j        k    sJ d S )NrT   r(  r  r  r   r{   r(  rT   r   )r   rT   rb   )r(  r   r   r"  r<   rU   z(could not convert string to float: 'foo'rj   rc   r   r=   rx  )r>   r)  r*  r  r   r?   r  ndimr|  ro   rC   r@   rq   rr   r   r   r  rD   rE   r   r%  r-   rX   r   r=   )rF   rI  rG   r  rd  rs   s         rJ   test_constructor_morez/TestDataFrameConstructors.test_constructor_more  s   i##A&&66r::sSE2???y~""""i##A&&66q99s^^y~""""y~"""" Sz2???y'))))Sz***y&((((RYr]]+++y')))) hu~V444<<QBB8]:S111 	C 	Cc!Q!EBBBB	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C y!45566
b+... '"C(((rwr/L/L/LMM)B--
 
 

 2:!####y"*,,,,,,s   ,GGGc                 N   t          g g           }t          g           }t          j        ||           t          g ddg          }t          i ddg          }t          j        ||           d }t           |            ddg          }t          j        ||           d S )Nrb   r  r{   r   c               3      K   dE d {V  d S r   r   r   rL   rJ   	empty_genzHTestDataFrameConstructors.test_constructor_empty_list.<locals>.empty_gen  s      MMMMMMMMMrL   r   )rF   rH   rI   r  s       rJ   test_constructor_empty_listz5TestDataFrameConstructors.test_constructor_empty_list  s    r$$$2&&&
b(+++ rC:...R#s444
b(+++	 	 	 yy{{S#J777
b(+++++rL   c                 h   t          ddgddggddg          }t          |d                   sJ |s|d         j        t          j        k    snnJ t          d	t          j        d
          i          }d t          d
          D             }t          |          }t          j        ||           d S )NrU   r   rT   r   numrA   r  r   r   r(  c                 6    g | ]}t          j        |          S r   r>   ro   r   s     rJ   r   zLTestDataFrameConstructors.test_constructor_list_of_lists.<locals>.<listcomp>  s     //////rL   )	r   r   r=   r>   r   r?   r   rD   rE   )rF   r   rH   rI   r   r   s         rJ   test_constructor_list_of_listsz8TestDataFrameConstructors.test_constructor_list_of_lists  s    aX3x05%.III5	*****4FTr%y"*,,,,,, a2/00//U2YY///4
fh/////rL   c                 `   t          ddg          }t          j        d d gt                    }||d<   |dz  |d<   t	          |          }t	          t          j        |                    }t          j        ||           |j        dk    sJ t          j	        |d         j
        |           d S )NrU   rT   r<   r   )rT   rU   )r    r>   ro   rC   r   rM  rD   rE   r|  r  r  )rF   serrG   rH   rI   s        rJ   .test_nested_pandasarray_matches_nested_ndarrayzHTestDataFrameConstructors.test_nested_pandasarray_matches_nested_ndarray  s    aVnnhd|6222AqAs^^RXc]]++
b(+++x6!!!!
#BqEL#66666rL   c                     t          d          t          d          g}t          g dg dg|          }t          j        |          }t          g dg dg|          }t	          j        ||           d S )NabcdcdefrC  r:   r   rO   r  r   )rE  r   r   from_arraysrD   rE   )rF   r   r   r  rI   s        rJ   2test_constructor_list_like_data_nested_list_columnzLTestDataFrameConstructors.test_constructor_list_like_data_nested_list_column&  s    v,,V-LLL,,,7HHH#F++lllLLL92FFF
fh/////rL   c                     t          d          t          d          g}d}t          j        t          |          5  t	          g dg dg|           d d d            d S # 1 swxY w Y   d S )Nr   cdez#3 columns passed, passed data had 4rj   rC  r  r   rE  rq   rr   r   r   rF   r   rs   s      rJ   0test_constructor_wrong_length_nested_list_columnzJTestDataFrameConstructors.test_constructor_wrong_length_nested_list_column0  s    u++tE{{+3]:S111 	D 	D|||\\\2FCCCC	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D   A!!A%(A%c                     t          d          t          d          g}d}t          j        t          |          5  t	          g dg dg|           d d d            d S # 1 swxY w Y   d S )Nr  r  zall arrays must be same lengthrj   rC  r  r   r  r  s      rJ   2test_constructor_unequal_length_nested_list_columnzLTestDataFrameConstructors.test_constructor_unequal_length_nested_list_column8  s    v,,U, /]:S111 	D 	D|||\\\2FCCCC	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	Dr  r   
2021-01-01r   r`   c                     t          |g ddg          }t          dt          d          gdz  i          }t          j        ||           d S )Nr  r   r   r  r;   )r   r"   rD   rE   r   s       rJ   &test_constructor_one_element_data_listz@TestDataFrameConstructors.test_constructor_one_element_data_listA  sY     4yyy3%@@@cIl$;$;#<q#@ABB
fh/////rL   c                      G d dt           j                  } |ddg           |ddg          g}ddg}t          ||	          }t          ddgddgg|	          }t          j        ||d
           d S )Nc                   (    e Zd ZddZd ZdefdZdS )PTestDataFrameConstructors.test_constructor_sequence_like.<locals>.DummyContainerreturnNc                     || _         d S r   )_lst)rF   lsts     rJ   __init__zYTestDataFrameConstructors.test_constructor_sequence_like.<locals>.DummyContainer.__init__U  s    			rL   c                 6    | j                             |          S r   )r  __getitem__)rF   ns     rJ   r  z\TestDataFrameConstructors.test_constructor_sequence_like.<locals>.DummyContainer.__getitem__X  s    y,,Q///rL   c                 4    | j                                         S r   )r  __len__)rF   s    rJ   r  zXTestDataFrameConstructors.test_constructor_sequence_like.<locals>.DummyContainer.__len__[  s    y((***rL   )r  N)__name__
__module____qualname__r  r  r%  r  r   rL   rJ   DummyContainerr  T  sR               0 0 0+ + + + + + +rL   r  rU   r   rT   r   r  rA   r   Fr  )r   Sequencer   rD   rE   )rF   r  lst_containersr   r   rI   s         rJ   test_constructor_sequence_likez8TestDataFrameConstructors.test_constructor_sequence_likeP  s    	+ 	+ 	+ 	+ 	+S\ 	+ 	+ 	+ ).!S22NNAs84L4LM%.>7;;;q#hC17CCC
fhEBBBBBBrL   c           	      F   t          dt          j        dt          d                    i          }t          dt          t          d                    i          }t	          j        ||d           t          t          t          d                    t          t          d                    g          }t          t          j        dt          d                    t          j        dt          d                    g          }t	          j        ||d           d S )Nr  rW  r(  Fr  )r   ro   r   rE  rD   rE   r  s      rJ   test_constructor_stdlib_arrayz7TestDataFrameConstructors.test_constructor_stdlib_arrayd  s     CS%))!<!<=>>c4b		??344
fhEBBBBd599ootE"II?@@EKU2YY77S%PR))9T9TUVV
fhEBBBBBBrL   c                     t          t          d                    }t          t          t          d                              }t          j        ||           d S Nr(  r   r   rE  rD   rE   r  s      rJ   test_constructor_rangez0TestDataFrameConstructors.test_constructor_rangeo  sG    599%%T%))__--
fh/////rL   c                    t          t          d          t          d          g          }t          t          t          d                    t          t          d                    g          }t          j        ||           d S r  r  r  s      rJ   test_constructor_list_of_rangesz9TestDataFrameConstructors.test_constructor_list_of_rangesu  sc    E"IIuRyy122d599ootE"II?@@
fh/////rL   c                      G d d          }t          g dgdz            }t           |                      }t          j        ||           d S )Nc                       e Zd ZdefdZdS )ATestDataFrameConstructors.test_constructor_iterable.<locals>.Iterr  c              3   :   K   t          d          D ]}g dV  	d S )Nr(  r  )r   )rF   rW  s     rJ   __iter__zJTestDataFrameConstructors.test_constructor_iterable.<locals>.Iter.__iter__}  s4      r $ $A#))OOOO$ $rL   N)r  r  r  r   r  r   rL   rJ   Iterr  |  s/        $( $ $ $ $ $ $rL   r  r  r(  r   )rF   r  rI   r   s       rJ   test_constructor_iterablez3TestDataFrameConstructors.test_constructor_iterablez  sp    	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$
 iii[2-..4466""
fh/////rL   c                     t          t          t          d                              }t          t          t          d                              }t	          j        ||           d S r  r   r  r   rE  rD   rE   r  s      rJ   test_constructor_iteratorz3TestDataFrameConstructors.test_constructor_iterator  sM    4b		??++T%))__--
fh/////rL   c                 D   t          t          t          d                    t          t          d                    g          }t          t          t          d                    t          t          d                    g          }t	          j        ||           d S r  r  r  s      rJ   "test_constructor_list_of_iteratorsz<TestDataFrameConstructors.test_constructor_list_of_iterators  so    DrOOT%))__=>>d599ootE"II?@@
fh/////rL   c                    d t          d          D             }d t          d          D             }t          t          t          d                    t          t          d                    g          }t          ||g          }t          j        ||           d t          d          D             }t          |          }t          t          d          dd          }t          j        ||d           d S )	Nc              3      K   | ]}|V  d S r   r   rV  s     rJ   r   zGTestDataFrameConstructors.test_constructor_generator.<locals>.<genexpr>  "      %%a%%%%%%rL   r(  c              3      K   | ]}|V  d S r   r   rV  s     rJ   r   zGTestDataFrameConstructors.test_constructor_generator.<locals>.<genexpr>  r  rL   c              3      K   | ]}|d gV  	dS )r   Nr   rV  s     rJ   r   zGTestDataFrameConstructors.test_constructor_generator.<locals>.<genexpr>  s&      ++A3x++++++rL   r   rV   Fr  )r   r   rE  rD   rE   )rF   gen1gen2rI   r   gens         rJ   test_constructor_generatorz4TestDataFrameConstructors.test_constructor_generator  s     &%599%%%%%599%%%d599ootE"II?@@D$<((
fh///++r+++3rs3344
fhEBBBBBBrL   c                     t          i g          }t          t          d          g           }t          j        ||           d S )NrU   r   )r   r   rD   rE   r  s      rJ   test_constructor_list_of_dictsz8TestDataFrameConstructors.test_constructor_list_of_dicts  s@    B4:a=="===
fh/////rL   c                     t          ddg          }t          ddg          }t          d|fd|fg          }t          |          }ddgdd	gd
}t          |ddg          }t          j        ||           d S )N)r   rU   )r   rT   )r   rT   )r   r   r   r   rU   rT   r   )r   r   r   r   )r   rc   )r   r   rD   rE   )rF   nested1nested2r   r   rI   s         rJ   3test_constructor_ordered_dict_nested_preserve_orderzMTestDataFrameConstructors.test_constructor_ordered_dict_nested_preserve_order  s    x233x233VW-/@ABB4AA//$sCj999
fh/////rL   	dict_typec                    t          ddggddg          } |            }dg|d<   dg|d<   t          |          }t          j        ||            |            }d|d<   d|d<   t          |g          }t          j        ||           d S )NrT   rU   r   r   r   r   )rF   r  rI   r   r   s        rJ   ,test_constructor_ordered_dict_preserve_orderzFTestDataFrameConstructors.test_constructor_ordered_dict_preserve_order  s     q!fXSz:::y{{CS	CS	4
fh///y{{S	S	D6""
fh/////rL   c                 d    |            }d|d<   d|d<    |            }d|d<   d|d<   ddd}t          ddgddggddg          }t          ||g          }t          j        ||           t          ddgddgddggddg          }t          |||g          }t          j        ||           d S )NrT   r   rU   r   r  r   r   )rF   r  row_onerow_two	row_threerI   r   s          rJ   0test_constructor_ordered_dict_conflicting_orderszJTestDataFrameConstructors.test_constructor_ordered_dict_conflicting_orders  s     )++)++!$$	q!fq!f-SzBBBGW-..
fh///q!fq!fq!f5SzJJJGWi899
fh/////rL   c                     d t          d          D             }t          |          }t          g dg dg ddg dg d          }t          j        ||           d S )Nc           	      P    g | ]#}t          |g d t          |                    $S )r   r   r   ru  )r    rA   rV  s     rJ   r   z[TestDataFrameConstructors.test_constructor_list_of_series_aligned_index.<locals>.<listcomp>  s1    RRRA&///A???RRRrL   r;   r  r  )0r  r  r  r  )rF   seriesr   rI   s       rJ   -test_constructor_list_of_series_aligned_indexzGTestDataFrameConstructors.test_constructor_list_of_series_aligned_index  s~    RRqRRR6""))))))))<<#OO!//
 
 

 	fh/////rL   c                      G d dt                     }ddd} ||          g}|g}t          |          }t          |          }t          j        ||           d S )Nc                       e Zd ZdS )TTestDataFrameConstructors.test_constructor_list_of_derived_dicts.<locals>.CustomDictNr  r  r  r   rL   rJ   
CustomDictr            DrL   r        ?r;   r9  )r3  r   rD   rE   )rF   r  r   data_customr   result_customr   s          rJ   &test_constructor_list_of_derived_dictsz@TestDataFrameConstructors.test_constructor_list_of_derived_dicts  s    	 	 	 	 	 	 	 	 A!z!}}os!+..4
fm44444rL   c                 V   t           j                            d                              d          t           j                            d                              d          d}t	          j        t          d          5  t          |           d d d            d S # 1 swxY w Y   d S )NrT   r(  r  rx  z%All arrays must be of the same lengthrj   )r>   r)  r*  r  rq   rr   r   r   ry  s     rJ   test_constructor_raggedz1TestDataFrameConstructors.test_constructor_ragged  s    &&q))99"==&&q))99!<<
 
 ]:-TUUU 	 	dOOO	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   BB"%B"c                     t          t          d                    }t          ddi|          }t          dg di|          }t          j        ||d           d S )Nr;   r   r   rb   )r   r   r   Fr  )r   r   r   rD   rE   )rF   r   rH   rI   s       rJ   test_constructor_scalarz1TestDataFrameConstructors.test_constructor_scalar  sb    E!HHooQxs+++c999-S999
b(>>>>>>rL   c                 j    t          |d         |j        dg          }|                                 d S )Nr  r   )r   rc   r   )rF   rI  rH   s      rJ    test_constructor_Series_copy_bugz:TestDataFrameConstructors.test_constructor_Series_copy_bug  s1    {3'{/@3%PPP
					rL   c                    i }dddd|d<   t          g dg d          |d	<   t          |          }|j        j        sJ t	          j        t          d
          5  t          ddgdddd           d d d            n# 1 swxY w Y   t          ddgt          ddgddg          d          }t          ddgddgdddg          }t          j        ||           d S )NrU   rT   r;   r  r  )r:   r;   rT   rU   )r"  quxr  r   rb   r{   zambiguous orderingrj   r   r   r9  rx  )	r    r   rc   is_monotonic_increasingrq   rr   r   rD   rE   r   s       rJ   &test_constructor_mixed_dict_and_Seriesz@TestDataFrameConstructors.test_constructor_mixed_dict_and_Series  sg   a22S	<<</K/K/KLLLS	4|3333 ]:-ABBB 	D 	DS#J3S-A-ABBCCC	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D #s&#sCQT:2V2V2VWWXXC:S#J??SzRRR
fh/////s   B  BBc                     ddgdg}t          |          }t          ddgddgg          }t          j        ||           d S )NrU   rT   r;   r:   r;   r:   r   r   s       rJ    test_constructor_mixed_type_rowsz:TestDataFrameConstructors.test_constructor_mixed_type_rows  sN    A4q!fq!f-..
fh/////rL   ztuples,lists)r   r   r  r  c                 l    t          |          }t          |          }t          j        ||           d S r   r   )rF   r  listsr   rI   s        rJ   test_constructor_tuplez0TestDataFrameConstructors.test_constructor_tuple  s7     6""U##
fh/////rL   c                     t          dddgi          }t          dt          ddg          i          }t          j        ||           d S )Nr  ri  r  r   r    rD   rE   r  s      rJ   test_constructor_list_of_tuplesz9TestDataFrameConstructors.test_constructor_list_of_tuples)  sQ    C&&!1233c666*:#;#;<==
fh/////rL   c                 `   t          dt          d                    } |dd           |dd          g}t          ddgddgd          }t          |          }t          j        ||           t          ddgddgd          }t          |d	d
g          }t          j        ||           d S )NPandasabrU   r;   rT   r:   r9  )r   r  r   r  r   )r   rE  r   rD   rE   )rF   named_tupler  rI   r   s        rJ   $test_constructor_list_of_namedtuplesz>TestDataFrameConstructors.test_constructor_list_of_namedtuples.  s     4::66+a##[[A%6%67Aq6A77886""
fh/// Aq6A77886C:666
fh/////rL   c                     t          ddt          fdt          fg          } |dd           |dd          g}t          ddgddgd          }t          |          }t          j        ||           d S )NPointr   r   r   r;   rU   r   r   )r   r%  r   rD   rE   )rF   r  r   rI   r   s        rJ   $test_constructor_list_of_dataclassesz>TestDataFrameConstructors.test_constructor_list_of_dataclasses;  s}    w#sc3Z(@AAaUU1a[[)Aq6A77884
fh/////rL   c                    t          ddt          fdt          fg          }t          ddt          fdt          fdt          fg          } |dd           |d	dd          g}t          dt          j        gddgt          j        d	gt          j        dgd
          }t          |          }t          j        ||           d S )Nr  r   r   HLinex0x1r   r;   rU   )r   r   r#  r$  )r   r%  r   r>   rp   rD   rE   )rF   r  r"  r   rI   r   s         rJ   7test_constructor_list_of_dataclasses_with_varying_typeszQTestDataFrameConstructors.test_constructor_list_of_dataclasses_with_varying_typesD  s     w#sc3Z(@AAw$tSkC:(NOOaUU1a^^,bf+QF261+bfa[QQ
 
 4
fh/////rL   c                    t          ddt          fdt          fg          }d}t          j        t          t          j        |                    5  t           |dd          dddg           d d d            d S # 1 swxY w Y   d S )	Nr  r   r   z0asdict() should be called on dataclass instancesrj   r   rU   r  )r   r%  rq   rr   r   reescaper   )rF   r  rs   s      rJ   1test_constructor_list_of_dataclasses_error_thrownzKTestDataFrameConstructors.test_constructor_list_of_dataclasses_error_thrownR  s    w#sc3Z(@AA A]9BIcNN;;; 	7 	7uuQ{{!!$4$45666	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7s   A<<B B c           	          ddddddddd	d
dddddddg}t          g dg dg dg dg dg dd          }t          |          }t          j        ||           d S )NrU   r:   r  r(  )FirstSecondThirdFourthr   rT   r  r  )r,  r+  r.  r-  rO   r;   r9   r     r  )r,  r+  r.  r-  YYYXXXr  r  )r  r  r  )r(  r  r9   )NNr/  )NNr  )r+  r,  r-  r.  r0  r1  r   )rF   r   rI   r   s       rJ   #test_constructor_list_of_dict_orderz=TestDataFrameConstructors.test_constructor_list_of_dict_order[  s     1qB??1Q??1QrRTUU

 "#))"&,,'''''' 	
 	
 4
fh/////rL   c                 t   t          g dg dd          }t          |          }|j        d         dk    sJ t          j        |j        |j                   t          j                            d          	                    d          }t          |d          }t          |          }t          d|i          }t          j
        ||           t          |t          d	d
                    }t          |          }t          d|i          }t          j
        ||           d}t          j        t          |          5  t          |ddg           d d d            n# 1 swxY w Y   t          g dt                    }t          |          }|j        d         dk    sJ t          |d          }t          ||g          j        }t          ||dddg          }t          j
        ||           t          ||g          j        }t          ||dddg          }t          j
        ||           d S )Nr  r   r   ru  r   rT   r(  r|   r;   r  rb   z<Shape of passed values is \(10, 1\), indices imply \(10, 2\)rj   rU   r   rn   r=   )r   	Unnamed 0r5  r  )r    r   r   rD   rG  rc   r>   r)  r*  r  rE   r   rq   rr   r   rC   r!  )rF   r   rH   rG   r)  rI   rs   s1s           rJ   test_constructor_Series_namedz7TestDataFrameConstructors.test_constructor_Series_namedo  si   999OOO#>>>q\\z!}####
bh000 i##A&&66r::3S!!!q\\c1X&&
b(+++3eArll+++q\\aV$$
b(+++M]:S111 	) 	)a!Q((((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 2Cv...q\\z!}#### Cc"""Cy!!#2C883BTUUU
b(+++ Ry!!#__q!f===
b(+++++s   E!!E%(E%c                    t          t          d          d          }t          t          d          d          }t          j        t	          |dg          |                                           t          j        t	          |dg          |                                           t	          |dg          j        sJ t	          |dg          j        sJ d S )Nr   r   r|   rU   r   )r    r   rD   rE   r   to_framer   )rF   s0r6  s      rJ   )test_constructor_Series_named_and_columnszCTestDataFrameConstructors.test_constructor_Series_named_and_columns  s     E!HH1%%%E!HH1%%% 	iQC888"++--HHH
iQC888"++--HHH aS)))////aS)))//////rL   c                    t          g dg dd          }t          g dg d          }t          ddg          }t          ||          }t          |                    |                    }|j        d         dk    sJ t          j        ||           t          ||          }t          |                    |                    }|j        d         dk    sJ t          j        |j        |           t          j        ||           d S )	Nr  r   r   ru  rb   r   r   r   )	r    r   r   rH  r   rD   rE   rG  rc   )rF   r6  s2other_indexdf1exp1r  exp2s           rJ   +test_constructor_Series_differently_indexedzETestDataFrameConstructors.test_constructor_Series_differently_indexed  s   III___3??? III___555S#J''+...K0011{1~$$$$
c4(((+...K0011{1~""""
ci555
c4(((((rL   z#name_in1,name_in2,name_in3,name_out))r   r   r   r   )r   r   NN)r   NNN)idx1idx2NN)rC  rC  rD  N)rC  rD  idx3N)NNNNc           	         t          g d|          t          g d|          t          g d|          g}d t          |g d          D             }t          |          }t          g d|          }t          dd	d
t          j        t          j        gt          j        dd	d
t          j        gt          j        t          j        dd	d
gd|          }	t          j        ||	           d S )Nr   r|   )r   r   r   )r   r   ec                 <    i | ]\  }}|t          g d |          S )r  rb   r   )r   rW  r   s      rJ   r  zJTestDataFrameConstructors.test_constructor_index_names.<locals>.<dictcomp>  s<     
 
 
.2aAviiiq)))
 
 
rL   )r   r   r  r   r   r   r   rG  r   rU   rT   rb   )r   r1  r   r>   rp   rD   rE   )
rF   name_in1name_in2name_in3name_outindicesr  r   exp_indrI   s
             rJ   test_constructor_index_namesz6TestDataFrameConstructors.test_constructor_index_names  s    ///111///111///111


 
69'???6S6S
 
 
 6""111AAAArvrv.faArv.fbfaA. 
 
 
 
 	fh/////rL   c                    t          |j        d d                   }t          |j        d d                   }d}t          j        t
          |d          5  t          |j        ||          }d d d            n# 1 swxY w Y   t          j        |j        t          |                     t          j        |j        t          |                     d S )Nr   r;   z#Passing a BlockManager to DataFrameF)rk   check_stacklevelr   )
rE  rc   r   rD   assert_produces_warningDeprecationWarningr   rY   rG  r   )rF   rI  rc   r   rs   r   s         rJ   test_constructor_manager_resizez9TestDataFrameConstructors.test_constructor_manager_resize  s   [&rr*++{*2A2.//3'cE
 
 
 	O 	O {/ugNNNF	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	flE%LL999
fneGnn=====s   A;;A?A?c                    t          |d         t          |d                   dddg          }t          j        ||j        d d ddgf                    d}t          j        t          |          5  t          |d         t          |d                   d d         d           d d d            d S # 1 swxY w Y   d S )Nr  r{   rx  r   zdoes not match index lengthrj   )r   rE  rD   rE   r  rq   rr   r   )rF   rI  rH   rs   s       rJ   %test_constructor_mix_series_nonseriesz?TestDataFrameConstructors.test_constructor_mix_series_nonseries  s%   c"k#.>)?)?@@3PS*
 
 
 	b+/!!!c3Z-"@AAA+]:S111 	Q 	QK,4C8H3I3I#2#3NOOPPP	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Qs   34B44B8;B8c                     d}t          j        t          |          5  t          t          j        dgddggt          j                   d d d            d S # 1 swxY w Y   d S )Nri   rj   rU   r   r<   )rq   rr   r   r   r>   rp   r5   r  s     rJ   %test_constructor_miscast_na_int_dtypez?TestDataFrameConstructors.test_constructor_miscast_na_int_dtype  s    J]-S999 	= 	={QF+28<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=s   ,AAAc                     t          ddggddg          }t          ddgg          }ddg|_        t          j        ||           t          j        dgddg          }t          j        ||           d S )Nr  r   r   r   )r  r   )r   r   rD   rE   from_records)rF   rH   edfidfs       rJ   "test_constructor_column_duplicatesz<TestDataFrameConstructors.test_constructor_column_duplicates  s    Ax#s444!Q!!Cj
b#&&&$fXSzBBB
c3'''''rL   c                 \   t          ddgddgt                    }t          ddgddgt                    }t          j        ||           t          ddgddgt
          j                  }t          j        ||           t          ddgddgd          }t          j        ||           d S )Nr   rU   r  U5)r   rC   rA   rD   rE   r>   str_r  s      rJ   (test_constructor_empty_with_string_dtypezBTestDataFrameConstructors.test_constructor_empty_with_string_dtype  s    Aq6Aq6HHHaVaV3???
b(+++aVaV27CCC
b(+++aVaV4@@@
b(+++++rL   c                 x    t          dg|          }t          dg|          }t          j        ||           d S )Nc1r   r=   r   )rF   nullable_string_dtyperI   rH   s       rJ   ,test_constructor_empty_with_string_extensionzFTestDataFrameConstructors.test_constructor_empty_with_string_extension  sE    dV3HIIIv-BCCC
b(+++++rL   c           
      6   t          dg dg d          }t          j        |t          t          j        |j                                      d          |j        |j                             t          dg dg d          }t          j        |t          t          j        |j                                      d          |j        |j                             t          dd	d
gddg          }t          j        |t          t          j	        ddgddggt                    d	d
gddg                     d}t          j        t          |          5  t          dd	d
g           d d d            n# 1 swxY w Y   t          j        t          |          5  t          dddg           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          dd	d
gddgt                     d d d            d S # 1 swxY w Y   d S )N        r  r   r   r-   r   r5   r   rU   rT   r   r<   z*DataFrame constructor not properly called!rj   r   zincompatible data and dtype)r   rD   rE   r>   rP  r|  rB   rc   r   ro   rC   rq   rr   r   r   r   )rF   rH   rs   s      rJ   test_constructor_single_valuez7TestDataFrameConstructors.test_constructor_single_value  s   s)))___EEE
	"(28,,33I>>"*UU	
 	
 	
 q			???CCC
	"(28,,33G<<bh
SS	
 	
 	
 s1a&3*===
3*sCj1@@@!fc
  	
 	
 	
 ;]:S111 	# 	#cAq6"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#]:S111 	/ 	/cC:....	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ ,]9C000 	6 	6cAq6C:u555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6s6   E77E;>E;F==GG%HHHc                 j   t          j        t                    j        }t          j        t           j                  j        }t          j        t           j                  j        }t          dddt          d          t          ddddd          dt          j	        d	          
          }|j
        }t          t          j        d          g|st          j        |          ndgdz  z   t          j        d          t          j        d          gz   t          d          
          }t          j        ||           t          dddddd|t          j        d|          |t          j        d|          it          j	        d	          
          }|j
        }t          t          j        d          gt          j        d          gz   |st          j        d          ndgz   t          j        d          gz   t          j        |          gz   ddd||g
          }t          j        ||           t          dddddd|t          j        dgd	z  |          |t          j        dgd	z  |          it          j	        d	          
          }|j
        }t          t          j        d          gt          j        d          gz   |st          j        d          ndgz   t          j        d          gz   t          j        |          gz   ddd||g
          }t          j        ||           d S )NrU   r   r"  20010101  rT   r   )r  r{   r$  r  Er(  rb   r5   r   M8[s]M8[us]ABCDEr   r   r   r   r<   r-   rC   )r>   r=   r%  rn   r-   r   r   r"   r
   r?   r4  r    rE  rD   r   ro   )rF   r   intname	floatname
objectnamerH   r   rI   s           rJ   test_constructor_with_datetimesz9TestDataFrameConstructors.test_constructor_with_datetimes4  s[   (3--$HRZ((-	Xbj)).
 z**dAq!Q//  )B--	
 	
 	
 Xg+=Krx
###8LqPQx  "(8"4"456 w--	
 
 
 	vx000 SQU28Cy999!7333 )B--	
 	
 	
 Xi  !x  !");Irx!!!JK x	""#$ x  !	"
 S)W5
 
 
 	vx000 SQU28SEBJi@@@1#('::: )B--	
 	
 	
 Xi  !x  !");Irx!!!JK x	""#$ x  !	"
 S)W5
 
 
 	vx00000rL   c                 z    t          ddd          }d |D             }t          |          }|j        dk    sJ d S )Nr  r  r(  startrL  rR   c                 6    g | ]}|                                 S r   to_pydatetimer   tss     rJ   r   zNTestDataFrameConstructors.test_constructor_with_datetimes1.<locals>.<listcomp>}  $    666BR%%''666rL   rv   )r$   r    r=   )rF   ind	datetimes
datetime_ss       rJ    test_constructor_with_datetimes1z:TestDataFrameConstructors.test_constructor_with_datetimes1z  sP    |#rBBB66#666	I&&
8++++++rL   c                 2   t          ddd          }d |D             }d |D             }t          |dg          }||d	<   |j        }t          t	          j        d
          t	          j        d          gdd	g          }t          j        ||           d S )Nr  r  r(  rx  c                 6    g | ]}|                                 S r   r{  r}  s     rJ   r   zNTestDataFrameConstructors.test_constructor_with_datetimes2.<locals>.<listcomp>  r  rL   c                 6    g | ]}|                                 S r   )r	   r}  s     rJ   r   zNTestDataFrameConstructors.test_constructor_with_datetimes2.<locals>.<listcomp>  s     )))r)))rL   r  r   datesdatetime64[ns]rC   rb   )r$   r   r4  r    r>   r=   rD   r   )rF   r  r  r  rH   r   rI   s          rJ    test_constructor_with_datetimes2z:TestDataFrameConstructors.test_constructor_with_datetimes2  s    |#rBBB66#666	))S)))y;-8887X&''(););<(
 
 
 	vx00000rL   c                    t          j        d          }|                    t          ddd                    }t	          d|idg          }|j        d         |k    sJ t          j        |j        t          ddit          	                     t	          d|ig          }|j        d         |k    sJ t          j        |j        t          dd
it          	                     d S )NrW    rU   zEnd Dater   rb   r  zdatetime64[us, US/Eastern]r<   datetime64[ns, US/Eastern])pytztimezonelocalizer
   r   iatrD   r   r4  r    rC   )rF   rS   ra   rH   s       rJ    test_constructor_with_datetimes3z:TestDataFrameConstructors.test_constructor_with_datetimes3  s     ]<(([[$1--..
B's333vd|r!!!!
Ivz+GHPVWWW	
 	
 	
 R()**vd|r!!!!
Ivz+GHPVWWW	
 	
 	
 	
 	
rL   c                    t          dd          }t          d|i          }|j        d         j        J t          ddd          }t          d|i          }t	          |j        d         j                  dk    sJ t          ddd          }t          d|i          }t	          |j        d         j                  dk    sJ d S )	N20130101r;   rr  rd   r  UTCrQ   rW  )r$   r   r  rS   rA   )rF   drrH   s      rJ    test_constructor_with_datetimes4z:TestDataFrameConstructors.test_constructor_with_datetimes4  s     
A...}%%vd|&&&
A%888}%%26$<?##u,,,,
A,???}%%26$<?##|333333rL   c                 6   t          dddd          }t          d|                                                    d          i          }t                      }||d<   t	          j        ||           t          d|i          }t	          j        ||           d S )	N1/1/2011r   10srW  rR   rL  rS   r   Tdropr$   r   	to_seriesreset_indexrD   rE   )rF   rW  rI   rH   s       rJ    test_constructor_with_datetimes5z:TestDataFrameConstructors.test_constructor_with_datetimes5  s     z15\JJJc1;;==#<#<$#<#G#GHII[[3
b(+++Qx  
b(+++++rL   c                    t          dddd          }t          ddd          }t          ||d          }t          |                                                    d	          |d          }t	          j        ||           d S )
Nr  r   r  rW  r  rR   rL  r9  Tr  r  )rF   rW  i_no_tzrH   rI   s        rJ    test_constructor_with_datetimes6z:TestDataFrameConstructors.test_constructor_with_datetimes6  s    z15\JJJZ???QW--..1;;==#<#<$#<#G#GgVVWW
b(+++++rL   rG   r   c                     t          |          j        }t          t          j        d          g          }t          j        ||           d S )Nr  )r   r4  r    r>   r=   rD   r   )rF   rG   r   rI   s       rJ   %test_constructor_datetimes_with_nullsz?TestDataFrameConstructors.test_constructor_datetimes_with_nulls  sF     3&28$455677
vx00000rL   order)Kr  r$  FrY  )r   r  hr   r)  msusr`   c                    d| d}t          j        g dg dg||          }t          |          }t          |                    d                    }|dv r^t	          j        t          d	          5  |                    |           d d d            n# 1 swxY w Y   |                    d
          }n|                    |          }t          j        ||           d S )Nzdatetime64[])z
2015-01-01z
2015-01-02z
2015-01-03)z
2017-01-01z
2017-01-02z
2017-02-03r=   r  rv   )r   r  r  r   Cannot castrj   zdatetime64[s]r<   )	r>   ro   r   rB   rq   rr   r   rD   rE   )rF   r  rY  r=   narH   rI   s          rJ   !test_constructor_datetimes_non_nsz;TestDataFrameConstructors.test_constructor_datetimes_non_ns  s8    &d%%%X:::::: 
 
 
 r]]RYYx0011'''y>>> ' '&&&' ' ' ' ' ' ' ' ' ' ' ' ' ' '  77HHU33H
b(+++++s   4BBB)r  r  r   r)  r  r  r`   c                    d| d}t          j        t          j        dd          t          j        dd          gt          j        dd          t          j        dd          gg||          }t          |          }|d	v rd
}n|}t          j        d| d          }t          t          dd          t          dd          gt          dd          t          dd          gg|          }t          j        ||           d S )Nztimedelta64[r  rU   r  rT   r:   r   r  )r  r  r   r)  zm8[r<   )r>   ro   r;  r   r=   r!   rD   rE   )	rF   r  rY  r=   r  rH   exp_unit	exp_dtyperI   s	            rJ   !test_constructor_timedelta_non_nsz;TestDataFrameConstructors.test_constructor_timedelta_non_ns  s'    't&&&X3''3)?)?@3''3)?)?@ 
 
 
 r]]?""HHHH.8...//	1c""Ia$5$561c""Ia$5$56 
 
 
 	b(+++++rL   c           	         t          d t          d          D                       }|j        }t          t	          j        d          gdz            }t          j        ||           t          d t          d          D                       }|j        }t          t	          j        d          gdz            }t          j        ||           t          dddgi          }|j        j        d	         t	          j        d
          k    sJ t          ddg          }|j        j        d	         t	          j        d
          k    sJ t          ddg          }|j        j        d	         t	          j        d          k    sJ t          dddgi          }|j        j        d	         t	          j        d
          k    sJ t          dddgi          }|j        j        d	         t	          j        d          k    sJ t          ddit          d                    }|j        j        d	         t	          j        d
          k    sJ t          ddit          d                    }|j        j        d	         t	          j        d          k    sJ t          g dg dt          d          d t          d          D             g dd          }|j        }t          t	          j        d
          t	          j        d          |st	          j        d          ndt	          j        d          t	          j        d          gt          d                    }t          j        ||           d S )Nc                 6    g | ]}t          j        d           S )r   )r>   r?   r   s     rJ   r   zSTestDataFrameConstructors.test_constructor_for_list_with_dtypes.<locals>.<listcomp>  s     777	!777rL   r   r%  c                 ^    g | ]*}t          j        t          j        d           d          +S )r   r4   r<   )r>   ro   r?   r   s     rJ   r   zSTestDataFrameConstructors.test_constructor_for_list_with_dtypes.<locals>.<listcomp>"  s/    PPP!1W===PPPrL   r4   r   l        l       r   r5   rU   rT   r   r   r-   r;   rb   )rU   rT   r:   r  )g333333?gffffff@gffffff@g333333@r  c                 0    g | ]}t          d dd          S )  rU   )r
   rV  s     rJ   r   zSTestDataFrameConstructors.test_constructor_for_list_with_dtypes.<locals>.<listcomp>E  s$    ===qhtQ**===rL   r:   )r   rT   r  r  rI  rC   r   r  abcde)
r   r   r4  r    r>   r=   rD   r   r  rE  )rF   r   rH   r   rI   s        rJ   %test_constructor_for_list_with_dtypesz?TestDataFrameConstructors.test_constructor_for_list_with_dtypes  s:   77eAhh7778828E??+a/00
vx000PPuQxxPPPQQ28G,,-122
vx000 eY/011y~a BHW$5$55555 1vy~a BHW$5$55555Sz""y~a BHY$7$77777aV}%%y~a BHW$5$55555c3Z())y~a BHY$7$77777QxuQxx000y~a BHW$5$55555Szq222y~a BHY$7$77777 !\\)))&\\==E!HH===%%% 
 
 !!##*<J"""()**## w--	
 	
 	
 	vx00000rL   c                     t          |d          }d|d<   |d         dk                                    sJ |d         dk                                    rJ d S )NTr  r   r  )r   r{  )rF   rI  cops      rJ   test_constructor_frame_copyz5TestDataFrameConstructors.test_constructor_frame_copyV  se    $///CCA""$$$$$$)..0000000rL   c                     |                                 }t          |          }|j        |j        usJ t          j        t          |                    |_        t          j        ||           d S r   )	r   r   rY   r>   r?   rX   rc   rD   rE   )rF   rI  origr  s       rJ   #test_constructor_frame_shallow_copyz=TestDataFrameConstructors.test_constructor_frame_shallow_copy\  sh     !!$$x{/////Ic#hh''	
k400000rL   c                    |s|j                                         }t          |          }d|d<   |r&|j         d         dk                                    rJ n%|j         d         dk                                    sJ t          |d          }d|d<   |j         d         dk                                    rJ d S |j                                         }t          |          }|j        j        d         j        j        sJ d|d<   |j        d         dk    sJ t          |d          }|j        j        d         j        j        rJ d	|d<   |j        d         d	k    sJ d S )
Nr   Tr  rO   r   ri  r  Fi  )	r  r   r   r{  rY   r   r  r  r  )rF   rI  r[   r  rG   rH   s         rJ   test_constructor_ndarray_copyz7TestDataFrameConstructors.test_constructor_ndarray_copyg  sx    # 	)$))++C3BCF" 1IaLA-22444444	!)..000003T***BCF	!)..0000000$))++C3B7>!$*7777CI74=C'''' 3U+++Bw~a(.;;;;CI74=D((((((rL   c                     |j         }t          d|d         id          }d|j        |j        d         |j        d         df<   |d         dk                                    rJ d S )Nr  Tr  r   r   rC  )r  r   r  rc   r{  )rF   rI  r  rH   s       rJ   test_constructor_series_copyz6TestDataFrameConstructors.test_constructor_series_copy  sp    $VC[)555 34rx{RXb\)3./3K1$))+++++++rL   rH   rb   g?g@r   r0  r  )rj  rU   rT   r   c                    t          t          |j                            D ]}|j        d d |f          t	          j        t          |j                            t          |j                           }t          |          dk    rQt          j        t          d          5  |j
        d d t          j        f          d d d            d S # 1 swxY w Y   d S t          |          dk    rEt          j        |j        d d |d         f         |j
        d d t          j        f                    d S t          j        |j        d d |f         |j
        d d t          j        f                    d S )Nr   z^nan$rj   rU   )r   rX   r   r  r>   r?   r%   rq   rr   KeyErrorr  rp   rD   r   rE   )rF   rH   rW  indexers       rJ   test_constructor_with_nasz3TestDataFrameConstructors.test_constructor_with_nas  s   " s2:'' 	 	AGAAAqDMMM)C
OO,,T"*-=-=> w<<1xw777 " "qqq"&y!!" " " " " " " " " " " " " " " " " " \\Q"27111gaj=#926!!!RV);LMMMMM !"'!!!W*"5rvaaai7HIIIIIs   "CCCc                     t          dt          j        dgi          }|d         j        t          j        k    sJ |d         d         rJ d S )Nr   FrU   )r   r>   rp   r=   r   )rF   r   s     rJ   &test_constructor_lists_to_object_dtypez@TestDataFrameConstructors.test_constructor_lists_to_object_dtype  sM    sRVUO,--v|rz))))S6!9rL   c                     t          g d          }t          j        |                              dd          }t          j        |d          }t          ||j                  }t          ||||d          }t          j        ||           d S )Nr#  rC  rU   r  r<   r0  )	r   r>   ro   r@   broadcast_tor   r=   rD   rE   )rF   catrG   r   rI   s        rJ   *test_constructor_ndarray_categorical_dtypezDTestDataFrameConstructors.test_constructor_ndarray_categorical_dtype  s    ///**hsmm##B**oc6**3ci000==>>
fh/////rL   c                    t          dt          d          id          }t          t          d          dd          }t          j        |d         |           t          t          d          d          }|                                }t          t          d          dd          }t          j        |d         |           |                    d          }t          t          d          dd          }t          j        |d         |           t          t          d          d          }t          t          d          dd          }t          j        |d         |           d S )	Nr  r   categoryr<   rm   r   r   r|   )r   rE  r    rD   r   r9  )rF   rH   rI   r)  r   s        rJ   test_constructor_categoricalz6TestDataFrameConstructors.test_constructor_categorical  s?    T%[[)<<<$u++ZcBBB
r#w111 4;;j111$u++Za@@@
vay(333''$u++ZeDDD
ve}h777 tE{{*555$u++Za@@@
r!uh/////rL   c                     t          t          d                    }t          |g          }t          |                    t                    g          }t          j        ||           d S )Nr   )r   rE  r   rB   rC   rD   rE   )rF   r  rH   rI   s       rJ   -test_construct_from_1item_list_of_categoricalzGTestDataFrameConstructors.test_construct_from_1item_list_of_categorical  s[     $u++&&ucjj00122
b(+++++rL   c                     t          t          t          d                    t          t          d                    g          }t          g dg dg          }t          j        ||           d S )Nr   abdr   )r   r   r   r   r   rE  rD   rE   r  s      rJ   (test_construct_from_list_of_categoricalszBTestDataFrameConstructors.test_construct_from_list_of_categoricals  se     DKK00+d5kk2J2JKLLooo?@@
b(+++++rL   c                     t          t          t          d                    t          d          g          }t          g dg dg          }t          j        ||           d S )Nr   defr   r   rG  fr  r  s      rJ   %test_from_nested_listlike_mixed_typesz?TestDataFrameConstructors.test_from_nested_listlike_mixed_types  s]     DKK00$u++>??ooo?@@
b(+++++rL   c                    t          t          t          d                    t          t          d                    g          }t          t          d          t          d          g          }t          j        ||           d S )Nr   abdefgr  r  s      rJ   0test_construct_from_listlikes_mismatched_lengthszJTestDataFrameConstructors.test_construct_from_listlikes_mismatched_lengths  sg    DKK00+d8nn2M2MNOOd5kk4>>:;;
b(+++++rL   c                 |   g d}t          |                              d          }t          |d          }t          j        ||           g d}t          |                              d          }t          |d          }t          j        ||           t	          dd          }t          t          t          j        t          j        t          j        gg d	                    }||_        t          d
|i          }t          d
t          g dd          i|          }t          j
        ||           d S )N)rU   rT   r;   rU   r  r<   )r   r   r   r   20000101r;   rr  r   )r  
categoriesr   rb   )r    rB   rD   r   r$   r   r>   rp   rc   r   rE   )rF   r  r  resrc   rI   rH   s          rJ   #test_constructor_categorical_seriesz=TestDataFrameConstructors.test_constructor_categorical_series  s1   Umm"":..U*---
sC((($$$Umm"":..U*---
sC((( :q1117OOOTTT
 
 c8_--VOOO:FFFGuUUU
b(+++++rL   r=   c                 X    t          dddgidg|          }|j        j        |k    sJ d S )Nr   rU   rT   r   rf  )r   r   r=   )rF   r=   r   s      rJ   %test_check_dtype_empty_numeric_columnz?TestDataFrameConstructors.test_check_dtype_empty_numeric_column	  s=     #1vUCCCv|u$$$$$$rL   c                     t          dddgidg|          }|r"|t          j        v rt          j        |           |j        j        j        dk    sJ d S )Nr   rU   rT   r   rf  rC   )r   rD   BYTES_DTYPESrG  &mark_array_manager_not_yet_implementedr   r=   rn   )rF   requestr=   r[   r   s        rJ   $test_check_dtype_empty_string_columnz>TestDataFrameConstructors.test_check_dtype_empty_string_column	  se     #1vUCCC 	?5BO#;#;5g>>>v| H,,,,,,rL   c                 0   t          dt                                                    j        }t          dt          i          }t	          j        ||           t          t          dt                              j        }t	          j        ||           d S )Nr   r4  )r    rC   r9  r4  rD   r   r   r  s      rJ   test_to_frame_with_falsey_namesz9TestDataFrameConstructors.test_to_frame_with_falsey_names'	  s}    Qf---6688?1f+&&
vx0006q77788?
vx00000rL   )Nr.   r  c                    t          dg di|pd          }t          t          d          dg|          }t          j        ||           t          dt          d          i|          }t          j        ||           d S )Nr  )r   rU   rT   r;   r:   r5   r<   r   rf  )r   r   rD   rE   )rF   r=   rI   r   s       rJ   test_constructor_range_dtypez6TestDataFrameConstructors.test_constructor_range_dtype0	  s     c???35;KGLLL 588cU%@@@
fh/// Cq?%888
fh/////rL   c           	           G d dt                     }t          g dg dg          }t           | |g d           |g d          g                    }t          j        ||           d S )Nc                       e Zd ZdS )ETestDataFrameConstructors.test_frame_from_list_subclass.<locals>.ListNr  r   rL   rJ   Listr  ?	  r   rL   r  r  r  )rE  r   rD   rE   )rF   r  rI   r   s       rJ   test_frame_from_list_subclassz7TestDataFrameConstructors.test_frame_from_list_subclass=	  s    	 	 	 	 	4 	 	 	 iii34444iii$$yyy// BCCDD
fh/////rL   extension_arraabbcz1/1/2017z1/1/2018)ry  endrL  c                     t          t          |                    }t          |          }t          j        ||           d S r   r  )rF   r  rI   r   s       rJ   %test_constructor_with_extension_arrayz?TestDataFrameConstructors.test_constructor_with_extension_arrayF	  s?     VM2233=))
fh/////rL   c           	      4   t          j                    }||f}t          |t          t	          d          t	          d                    i|g          }t          g dt          t          |g                              }t          j        ||           d S )Nr;   rb   r   r  )r	   todayr   r    r   r   rD   rE   )rF   r  tupr   rI   s        rJ   *test_datetime_date_tuple_columns_from_dictzDTestDataFrameConstructors.test_datetime_date_tuple_columns_from_dictU	  s    JLLdCaa!A!A!ABSERRRYYYfcUmm0D0DEEE
fh/////rL   c           	      ^   t          g dt          g d                    }t          g dt          g d                    }t          ||g          }t          t          j        dddt          j        t          j        gg d	g          g d
          }t          j        ||           d S )N)'   rO   r:   )femalemaleunknownrb   )rT      rT         )r  r  r   r  r  r  rO   r:   )g      c@g     @n@g     b@r   r   )r  r  r  r  r   r   )r    r   r   r>   ro   rp   rD   rE   )rF   r6  r=  r   rI   s        rJ   /test_construct_with_two_categoricalindex_serieszITestDataFrameConstructors.test_construct_with_two_categoricalindex_series]	  s    JJJ&67T7T7T&U&UVVV!!!"#J#J#JKK
 
 
 B8$$Hr1a02Q2Q2QRSS;;;
 
 
 	fh/////rL   c                 R   t          t          d                    }t          |d                                                              d          }t          |d                                                              d          }t          ||d          }t          t          ddd          t          dd	d          t          d	d
d          t          d
dd          t          ddd          t          ddd          t          ddd          t          ddd          t          ddd          t          ddd          g
d          }t          dgdz  t          j
        gdz  z   t          j
        gdz  dgdz  z   d|          }t          j        ||           d S )Nri  r(  r   r  gMbXg#@rV  )closedg3@g33333=@gC@g     H@g33333M@g33333SQ@gS@gfffffFV@r   T)orderedrb   )r    r   r#   value_countsheadtailr   r   r   r>   rp   rD   rE   )rF   r  ser1ser2r   rc   rI   s          rJ   1test_constructor_series_nonexact_categoricalindexzKTestDataFrameConstructors.test_constructor_series_nonexact_categoricalindexk	  s   U3ZZ  3||((**//223||((**//22D1122 W555d7333tG444tG444tG444tG444tG444tG444tG444r'222 
 
 
 $(bfX\)1tax0GHHPU
 
 
 	h/////rL   c                    t          ddddd          t          ddddd          fg}t          j        |ddg	          }t          |          }|d
         d         |d         d         k    sJ |d         d         |d         d         k    sJ t	          |d
                   }t          |d         t                    sJ |d         |d         d         k    sJ d S )Nr  r  r   r  r  r(  )Daterq  )Forecastingrq  r<   r  r  rU   )r
   r>   ro   r   r    r   r"   )rF   r  rG   rH   r)  s        rJ   test_from_M8_structuredz1TestDataFrameConstructors.test_from_M8_structured	  s    4Aq!,,htQ2r.J.JKLhu%79R$STTTs^^&z!}a++++- #uQx{22223v;!A$	*****tuQx{""""""rL   c           
           G d dt                     }t          d |ddddd          gi          }|j         j        dk    sJ d S )Nc                       e Zd ZdS )OTestDataFrameConstructors.test_from_datetime_subclass.<locals>.DatetimeSubclassNr  r   rL   rJ   DatetimeSubclassr  	  r   rL   r  r
   i  rU   r  )r
   r   r=   )rF   r  r   s      rJ   test_from_datetime_subclassz5TestDataFrameConstructors.test_from_datetime_subclass	  st    	 	 	 	 	x 	 	 	 *'7'7aAq'I'I&JKLL}"&6666666rL   c                     t          ddd          }d}t          j        t          |          5  t	          |t          d                     d d d            d S # 1 swxY w Y   d S )	NrN   r;   rP   rQ   z@Shape of passed values|Passed arrays should have the same lengthrj   r:   rb   )r$   rq   rr   r   r   r   )rF   r\   rs   s      rJ   (test_with_mismatched_index_length_raiseszBTestDataFrameConstructors.test_with_mismatched_index_length_raises	  s    q\BBBP]:S111 	+ 	+cq****	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+s   AA #A c                 X   t          ddd          }t          j        |          }t          t          j                            d                              t          |                    |d          }t          j        |d         j	        t          j	        d                    sJ d S )	Nz1/1/2000 00:00:00z1/1/2000 1:59:50r  rK  rT   rx  r{   rv   )
r$   r>   rk  r   r)  r*  r  rX   
issubdtyper=   )rF   rK  r  rH   s       rJ   !test_frame_ctor_datetime64_columnz;TestDataFrameConstructors.test_frame_ctor_datetime64_column	  s    ,.@uMMM
3)''**::3s88DD5QQ
 
 }RW]BHX,>,>???????rL   c                    g dg dg}t          t          j                            d                              d          d |D                       }t          |j        t                    sJ t          |j        t                    rJ t          t          j                            d                              d          |          }t          |j        t                    sJ d S )N)r   r   r   r   )r   r   r   r   rT   )r:   r:   c                 6    g | ]}t          j        |          S r   r  r   s     rJ   r   zYTestDataFrameConstructors.test_dataframe_constructor_infer_multiindex.<locals>.<listcomp>	  s     444128A;;444rL   rb   r   )	r   r>   r)  r*  r  r   rc   r   r   )rF   index_listsmultis      rJ   +test_dataframe_constructor_infer_multiindexzETestDataFrameConstructors.test_dataframe_constructor_infer_multiindex	  s    +++-A-A-ABI!!!$$44V<<44444
 
 
 %+z22222emZ88888I!!!$$44V<<k
 
 
 %-4444444rL   
input_valsr  r  r  r  r  r  c                     t          d|i|          }t          d|i                              d|i          }t          j        ||           d S )Nr  r<   )r   rB   rD   rE   )rF   r&  r@  r   rI   s        rJ   test_constructor_list_strz3TestDataFrameConstructors.test_constructor_list_str	  sY     C,LAAAc:.//66\7JKK
fh/////rL   c                     t          dg di|          }t          dg dit                    }t          j        ||           d S )Nr  r  r<   )z1.0z2.0N)r   rC   rD   rE   )rF   r@  r   rI   s       rJ   test_constructor_list_str_naz6TestDataFrameConstructors.test_constructor_list_str_na	  sW    C!1!1!12,GGGc#7#7#78GGG
fh/////rL   r   FTc                 >  
 |r1|s/|t           j        t           j        z   vrt          j        |           t          j        ddg|          
t          j        ddg|          j        j        dv rt          j
        j         d           t          j        ddg|                                          }t          
d|	          d
 ddt          f
fd}|s
 |             t          j        j        j        d         d          rd }	nt&          }	t          j        |	d          5  dj        d<   dj        d<   d d d            n# 1 swxY w Y   |s |d           t          j        ddgj                  j        d d df<   j        j        d         j        k    sJ |s|s |d           |r
j        j        dk    rO
d         
j                            dd          k    sJ d         j                            dd          k    sJ nL
d         
j                            d          k    sJ d         j                            d          k    sJ d         |d         k    sJ d S |sd         dk    sJ d S d S )NrU   rT   r<   r;   r:   )SUz2 get cast, making the checks below more cumbersomer   r  c                     t          | t          j                  r| j        S t          | j        t          j                  r| j        j        S t          r   )r   r>   ndarraybaser=   _ndarrayr   r   s    rJ   get_basez<TestDataFrameConstructors.test_dict_nocopy.<locals>.get_base	  sC    #rz**  xCIrx00  |((rL   Fc_onlyc                    t          fdj        j        D                       dk    sJ | rd S t          fdj        j        D                       dk    sJ t          fdj        j        D                       dk    sJ d S )Nc              3       K   | ]}|u V  	d S r   r   )r   r   r   s     rJ   r   zRTestDataFrameConstructors.test_dict_nocopy.<locals>.check_views.<locals>.<genexpr>	  s'      66!qAv666666rL   rU   c              3   p   K   | ]0}t          |j        t          j                  ! |          u V  1d S r   r   r=   r>   )r   r   r   r3  s     rJ   r   zRTestDataFrameConstructors.test_dict_nocopy.<locals>.check_views.<locals>.<genexpr>
  X        !!'2844HQKK1$     rL   c              3   p   K   | ]0}t          |j        t          j                  ! |          u V  1d S r   r8  )r   r   r   r3  s     rJ   r   zRTestDataFrameConstructors.test_dict_nocopy.<locals>.check_views.<locals>.<genexpr>
  r9  rL   )sumrY   r   )r4  r   r   r   rH   r3  s    rJ   check_viewsz?TestDataFrameConstructors.test_dict_nocopy.<locals>.check_views	  s     6666rw~66666!;;;;        W^    
          W^    
      rL   r   fciuOzincompatible dtyperj   r  rV   TrZ  .   r   r`   )F)rD   STRING_DTYPESr  rG  r  r>   ro   r=   r   rq   skiprM  r   r   rO  r   is_np_dtyper4  r  FutureWarningrS  type)rF   r  r   any_numeric_ea_dtypeany_numpy_dtyper[   r  c_origr<  warnr   r   r   rH   r3  s             @@@@@rJ   test_dict_nocopyz*TestDataFrameConstructors.test_dict_nocopy	  s_     	?	?  r'7"/'III 5g>>>HaV?333HaV?3337<:%%K17VVVWWWHaV#7888QQQ//d;;;	  	  	 	 	 	 	 	 	 	 	 	 	 	 	<  	KMMM ?29>!,g66 	!DD D'4HIII 	 	BGDMBGDM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	  	K "b9991y~a AG++++ 	/ 	K 	w|s""tqw||At444444tqw||At4444444tqw||A....tqw||A....Q46!9$$$$$$$ 	 Q42::::	 	 :s   :EE"Ec                     t          g dd          }t          d|i          }t          j        |j        j        |d         j        j                  rJ d S )Nr  r  r<   r   )r    r   r>   r  r  rW   )rF   r  rH   s      rJ   "test_construct_from_dict_ea_seriesz<TestDataFrameConstructors.test_construct_from_dict_ea_series9
  sX     YYYg...Sz""#CJ$4bgn6JKKKKKKKrL   c                     t          t          dd          dg          }t          dg          }t          j        ||           d S )NrU   r   r|   r"  r   r  r  s      rJ   'test_from_series_with_name_with_columnszATestDataFrameConstructors.test_from_series_with_name_with_columns@
  sN    6!%0005'BBBeW---
fh/////rL   c                     t          g dg dgg dg dg          }t          g dg dgt          j        g d                    }t          j        ||           d S )Nr  r  )r  r  r  r   r   ))r  r   )r  r   )r  r   )r   r   r  rD   rE   r  s      rJ   test_nested_list_columnsz2TestDataFrameConstructors.test_nested_list_columnsF
  s    YY			"___ooo,N
 
 
 YY			"*+O+O+OPP
 
 
 	fh/////rL   c                    t          j        dd          }|j                            t                                        dd          }t          |          }|j        dk    sJ |j        |j	        k    
                                sJ ||k    
                                
                                sJ t           j                            g d          }|j                            t                                        dd          }t          |          }|j        dk    sJ |j        |j	        k    
                                sJ ||k    
                                
                                sJ t          j        ||||f         j        }t          |          }t          ||||d          }	t!          j        ||	           d S )	Nz
2016-04-05r;   rr  rU   rC  rU   r;   )r;   r:   r   rO   r0  )rM  r^  rW   rB   rC   r@   r   r|  r4  r=   r{  IntervalIndexfrom_breaksr>   r_r!  rD   rE   )
rF   pir   rH   iidata2r  data3rL  rI   s
             rJ   1test_from_2d_object_array_of_periods_or_intervalszKTestDataFrameConstructors.test_from_2d_object_array_of_periods_or_intervalsQ
  s   _\1555xv&&..q"55t__x6!!!!	RX%**,,,,,b~~##%%%%%)),,,77''//266yF""""
bh&++-----r	  $$&&&&& dE4./1rb99::
c8,,,,,rL   zcol_a, col_bc                     d}t          j        t          |          5  t          ||d           d d d            d S # 1 swxY w Y   d S )Nz,Per-column arrays must each be 1-dimensionalrj   r9  r  )rF   col_acol_brs   s       rJ   test_error_from_2darrayz1TestDataFrameConstructors.test_error_from_2darrayg
  s     =]:S111 	0 	0E..///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   >AAc                    t          g dg dd          }t          j        |d         j        |d         j                  rJ d|j        d<   t          dt          j        t          j        gt          j        t          j        t          j        gt          j        t          j        t          j        gdg dt          	          }t          j        ||           d S )
Nr  r   F)rc   r   r   r   r   r   r  rc   r=   )	r   r>   r  _valuesr  rp   rC   rD   rE   r  s      rJ   &test_from_dict_with_missing_copy_falsez@TestDataFrameConstructors.test_from_dict_with_missing_copy_falset
  s    YYYeLLL#BsGORW_EEEEE(fbfbf-fbfbf- 
 ))
 
 
 	b(+++++rL   c                     d}t          j        t          |          5  t          t	          j        g           ddg           d d d            d S # 1 swxY w Y   d S )Nz:Shape of passed values is \(0, 1\), indices imply \(0, 2\)rj   r   r   r  )rq   rr   r   r   r>   ro   r  s     rJ   1test_construction_empty_array_multi_column_raiseszKTestDataFrameConstructors.test_construction_empty_array_multi_column_raises
  s    K]:S111 	= 	=28B<<#s<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	=s   &AAAc                     t          g ddgd          }t          dg did          }t          j        ||           d S )N)r  r  Nr   rA   rf  r<   r   r  s      rJ   $test_construct_with_strings_and_nonez>TestDataFrameConstructors.test_construct_with_strings_and_none
  sV    '''#eDDDc#3#3#34EBBB
b(+++++rL   c           	      :   t          j        d           d}t          dddgi|t          dg|                    }t	          j        dd          5  t          dddgi          }d d d            n# 1 swxY w Y   t          j        ||           t          dddgi|t          dg|          t          d	d
g|                    }t	          j        dd          5  t          dddgid	d
g          }d d d            n# 1 swxY w Y   t          j        ||           t          dddgidt          dg|                    }t	          j        dd          5  t          dddgi          }d d d            n# 1 swxY w Y   t          j        ||           t          dddgidt          dg|                    }t	          j        dd          5  t          dddgid          }d d d            n# 1 swxY w Y   t          j        ||           d S )Npyarrowstring[pyarrow_numpy]r   r   r<   r=   r   future.infer_stringTr   r   )r=   r   rc   rb   rU   rC   )rq   importorskipr   r   rM  option_contextrD   rE   rF   r=   rI   rH   s       rJ   test_frame_string_inferencez5TestDataFrameConstructors.test_frame_string_inference
  sm   I&&&'3*UE3%u4M4M4M
 
 
 4d;; 	. 	.C#s,--B	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	.
b(+++3*3%u---c
%000	
 
 
 4d;; 	@ 	@C#s,S#J???B	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@
b(+++3(O8UC55N5N5N
 
 
 4d;; 	, 	,C#q?++B	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,
b(+++3*XucU%7P7P7P
 
 
 4d;; 	> 	>C#s,H===B	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>
b(+++++sH   A22A69A6DD
DE>>FFG;;G?G?c                 |   t          j        d           d}t          dddgi|t          dg|                    }t	          j        dd          5  t          dt          j        ddg          i          }d d d            n# 1 swxY w Y   t          j	        ||           t          ddgd	d
gd|          }t	          j        dd          5  t          t          j        dd	gdd
gg                    }d d d            n# 1 swxY w Y   t          j	        ||           t          ddgd	d
gd|t          ddg|                    }t	          j        dd          5  t          t          j        dd	gdd
gg          ddg          }d d d            n# 1 swxY w Y   t          j	        ||           d S )Nrf  rg  r   r   r<   rh  ri  Tr   r   rV   r9  r   )
rq   rj  r   r   rM  rk  r>   ro   rD   rE   rl  s       rJ   .test_frame_string_inference_array_string_dtypezHTestDataFrameConstructors.test_frame_string_inference_array_string_dtype
  s   I&&&'3*UE3%u4M4M4M
 
 
 4d;; 	8 	8C3*!5!5677B	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8
b(+++#sc
;;5III4d;; 	? 	?28c3Z#s$<==>>B	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?
b(+++*C:..3*E222
 
 

 4d;; 	S 	S28c3Z#s$<==SzRRRB	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S
b(+++++s6   &BBB(DD	D	$,FF #F c                    t          j        d           t          j        dd          5  t	          t          j        ddgddgg                    }d d d            n# 1 swxY w Y   |j        j        d         j	        dk    sJ d S )	Nrf  ri  ThellogoodbyeHellor   rT   )
rq   rj  rM  rk  r   r>   ro   rY   rZ   r  rx   s     rJ   %test_frame_string_inference_block_dimz?TestDataFrameConstructors.test_frame_string_inference_block_dim
  s    I&&&4d;; 	Q 	Q28gy%9GW;M$NOOPPB	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Q 	Qw~a %******s   (AA"%A"c                    t          t          d          gt                    }t          j        t
          d          5  t          |dg          }d d d            n# 1 swxY w Y   |j        j        d         t          j
        k    sJ t          d|i          }|j        j        d         t          j
        k    sJ t          t          d          gt                    }t          j        t
          d          5  t          |dg          }d d d            n# 1 swxY w Y   |j        j        d         t          j
        k    sJ t          d|i          }|j        j        d         t          j
        k    sJ d S )Nz
2019-12-31r<   zDtype inferencerj   r   r   r   )r   r"   rC   rD   rS  rB  r   r4  r  r>   r   r    )rF   r   r   r  s       rJ    test_inference_on_pandas_objectsz:TestDataFrameConstructors.test_inference_on_pandas_objects
  s   Y|,,-V<<<'=NOOO 	3 	3sSE222F	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3}!!$
2222C:&&}!!$
2222i--.f==='=NOOO 	3 	3sSE222F	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3}!!$
2222C:&&}!!$
222222s$    AA#&A#>DD!$D!)r  r  r  rK   r^   rg   rt   ry   r   r   r   r   rq   markparametrizer   r   r   r   r   r   r   r   r   r  r  rG  skip_array_manager_invalid_testxfailr   r  r  r  r!  r7  r=  rA  rM  rR  r`  r>   ro   rC   rd  r/   r0   r1   rg  rn  r  r  r  r  r  r  r  rp   r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r$  r8  rI  rO  rT  r   r   r   r   r"   r   r[  ra  re  rg  rl  filterwarningsro  rs  rz  r}  rE  r   r   r=   r%  r  rM  BooleanDtypeFloat64Dtype
Int64DtypeStringDtyper  r  r  r  r  r  r  r  r  r  r  r  rf   r  r  r  r  r  r  r  r  r  r  r  r3  r   r  r  r  r  r  r  r
  r  r  r  r  r  r   r%  r)  r2  r7  r;  rB  rP  rU  rX  rZ  r_  rc  rh  rk  rv  r  r  r  r  r  r  r
   rw   r   r   r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  rD   ALL_NUMERIC_DTYPESDATETIME64_DTYPESTIMEDELTA64_DTYPESBOOL_DTYPESr  r?  r  OBJECT_DTYPESr  r  arm_slowr  r  r   r)   r'   r(   r^  r  r   r	  r  r  r  r  r   r%  r$   r(  r*  rH  rJ  rL  rN  rX  r\  r`  rb  rd  rm  ro  rt  rv  r   rL   rJ   r7   r7   O   s       , , ,	, 	, 	,, , ,	/ 	/ 	/1 1 11 1 1    	1 	1 	1 [Vc3Z00J J 10JB0 0 0 [##!!!!,,''((&&&&33,,	
  0 0!  0 [!!&&	
 G G G [3T::a==**Q--0"Xzz!}}jjmm4o"ooo

1zz!}}=	
 0 0 0
8 8 8. . .*) ) )) ) )9 9 9  '[1133<OPP0 0 QP ('0 '[1133<OPP0 0 QP ('0# # #
   [ bMAE667BK	

 
) )
 
).% % %	' 	' 	'- - -&+ + +3 3 3* [BHeWF+++BHaeWKBHl^6222BHl^$$"uX\N	

 
% %
 
% [BHaS	***BHaS	***BHaS	***RYq\\NRYq\\NRYq\\N	

 
% %
 
%, , ,&I &I &IP> > >
" " "' ' 'F F F
; ; ;1 1 1 [X264'=>>0 0 ?>0 [Wq"&$e&EFF0 0 GF0$ [WrvtUU5\\&BCC0 0 DC0$/ / /0 0 0- - -, , ,&:/ :/ :/x) ) )5 5 59 9 9. . .. . .5 5 5
) ) )C C C0 0 00 0 00 0 0, , ,6: : :8 [--}=((-8((/:55~F		
 0 0 0(( ( (, , , [VIC 0 01X1A&&&gw(G(GH	,<888S\:::	

 

, 
,
 

,* * *(6' 6' 6'p  3 3 3  [A ?& ?& ?&B0 0 0,' ' ') ) ) [/44b		??S#J
C4#sWhbhw.?.?@44b		??S#JXRXi5H5HIu~tRZ81XttEE"IIUS("(9:M:MN	
	 	+ +	 	+ [)   )R_=y"/:\\7BM2__h7		
 1 1 1X X X/ / /2 2 20 0 0%- %- %-N, , ,"0 0 07 7 70 0 0D D DD D D [i%%&'99\**+,99\**+,))L))11$778		
 0 0 0C C C(	C 	C 	C0 0 00 0 0
	0 	0 	00 0 0
0 0 0
C C C0 0 0
0 0 0 [[4*=>>0 0 ?>0$ [[4*=>>0 0 ?>0*0 0 05 5 5  ? ? ?  0 0 0"0 0 0 [H2JBx Bx "XBx cA3Z1#s$ii#iii%;<	
 0 0 00 0 0
0 0 00 0 00 0 07 7 70 0 0($, $, $,L0 0 0) ) )( [-	
 	
 	
 0 0 00
> 
> 
>Q Q Q= = =
( 
( 
(	, 	, 	,, , ,6 6 6@D1 D1 D1L, , ,1 1 1
 
 
$4 4 4, , ,, , , [BHdD$lhlnndCDDBHdD,(,..$788bmE""#dV,bmE""#bfX.VmbmE**+,VbfXfXe,,-.fXv		
 1 1 1 [W&:&:&:;;[333 , ,	  <;
,. [W&:&:&:;;[	
 	
 	
 , ,  <;,891 91 91v1 1 1	1 	1 	1) ) )<, , , [Iyyy))),QK@@@Iyyy))),sC6HIIII|||\\\2RVS#rv<VWWWI!!!<<<0263RV:T   I'''6Aq@QRRR	
 J J J*  0 0 00 0 0,, , ,, , ,, , ,, , ,
, , ,. [


	

	  .	 % % % [!BO3b6FF 	- 	- 	-1 1 1 [[W&A&A&ABB	0 	0 CB 	00 0 0 [KW&&KBFBFBF344M88Aq>>88Aq>>:;;KjjsSSSTT		
 0 0 00 0 00 0 00 0 04
# 
# 
#7 7 7+ + +@ @ @5 5 5 [V3ZT**Z===>>T**ZNNNOOhAQ'''(	
	 	0 0	 	00 0 0
 [VeT]33d d 43dPL L L0 0 0	0 	0 	0- - -, [cA3ZA3*--.RXsQCj!!QC!:.RXsQCj!!828aS1#J#7#78	
 0 0 0
, , ,"= = =, , ,!, !, !,F, , ,2+ + +3 3 3 3 3rL   r7   c                   z    e Zd Zd Zd Zej                            ddddgdgdddgd	gg          d
             ZdS )&TestDataFrameConstructorIndexInferencec                    t          j        ddd          }t          t          j                            d                              t          |                    |          }t          j        ddd          }t          t          j                            d                              t          |                    |          }t          ||d          }t          j        ddd          }t          j
        |j        |           d S )	Nz1/1/19991/1/2012r   rK  rT   z1/1/1980z	12/1/2001)r6  r=  )rM  r^  r    r>   r)  r*  r  rX   r   rD   rG  rc   )rF   rng1r6  rng2r=  rH   r  s          rJ   Atest_frame_from_dict_of_series_overlapping_monthly_period_indexeszhTestDataFrameConstructorIndexInference.test_frame_from_dict_of_series_overlapping_monthly_period_indexes
  s    z:C@@@BI))!,,<<SYYGGNNz;SAAABI))!,,<<SYYGGNNb++,,oj*3???
bh,,,,,rL   c                    t          dd          }t          t          d          |          }t          t          d          |                    d                    }t          t          d          |                    d                    }t          t          d                    }t	          |||d          }t          t          |j                  t          |j                  z   t          |j                  z   t                    }t          j
        |j        |           t	          |||d	          }t          t          |j                  t          |j                  z   t          |j                  z   t                    }	t          j
        |j        |	           t	          |||d
          }
t          t          |j                  t          |j                  z   t          |j                  z   t                    }	t          j
        |
j        |	           t	          |||d          }t          t          |j                  t          |j                  z   t          |j                  z   t                    }t          j
        |j        |           d}t          j        t          |          5  t	          ||||d           d d d            n# 1 swxY w Y   t          j        t          |          5  t	          |||d           d d d            n# 1 swxY w Y   t          j        t          |          5  t	          |||d           d d d            d S # 1 swxY w Y   d S )NrN   r;   rr  rb   r  z
US/Centralr#  r<   )r  r$  r{   )r{   r  r$  )r$  r{   r  z0Cannot join tz-naive with tz-aware DatetimeIndexrj   )r  r{   r$  r  )r  r{   r  )r  r  r{   )r$   r    r   r}   r   r   rE  rc   rC   rD   rG  rq   rr   r   )rF   r\   r  r  ser3ser4r?  	exp_indexr  
exp_index3rL  df4
exp_index4rs   s                 rJ   /test_frame_from_dict_with_mixed_tzaware_indexeszVTestDataFrameConstructorIndexInference.test_frame_from_dict_with_mixed_tzaware_indexes
  s   q111eAhhc***eAhhcooe&<&<===eAhhcool&C&CDDDeAhh dD99::tDJ///$tz2B2BB&
 
 
	 	ci333dD99::tDJ///$tz2B2BB&
 
 

 	ci444dD99::tDJ///$tz2B2BB&
 
 

 	ci444dD99::tDJ///$tz2B2BB&
 
 

 	ci444 A]9C000 	D 	DDt$TBBCCC	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D]9C000 	9 	9Dt$77888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9]9C000 	9 	9Dt$77888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9s6   K((K,/K,L..L25L2M55M9<M9zkey_val, col_vals, col_typer  4utf8r;   r:   r2   c                 2   t          j        d          }t          j                            |                    ||                    |                                 t          ||                                                    }t          |ddgi|          }t          dt          j        gdt          j        gg|          }|                    d|j        d d df                             t                               t!          j        ||           d S )Nrf  )rC  rU   rT   r   )rq   rj  rM  r   ArrowExtensionArrayro   
dictionaryr2   getattrr   r>   rp   isetitemr  rB   rC   rD   rE   )rF   key_valcol_valscol_typepar  r   rI   s           rJ   %test_dict_data_arrow_column_expansionzLTestDataFrameConstructorIndexInference.test_dict_data_arrow_column_expansion  s      ++y,,HHXBMM"''))=RWR=R=R=T=T$U$UHVV
 
 GaV,d;;;q"&kArv;7FFF!X]111a4077??@@@
fh/////rL   N)	r  r  r  r  r  rq   rw  rx  r  r   rL   rJ   r  r  
  s        	- 	- 	-*9 *9 *9X [%3*f%A	
 	0 	0 	0 	0 	0rL   r  c                       e Zd Zd ZdS ))TestDataFrameConstructorWithDtypeCoercionc                    t           j                            d                              d          }d}t	          j        t          |          5  t          |d           d d d            n# 1 swxY w Y   t          |                                d          }|j	        dk    
                                sJ t           j        |d<   d}t	          j        t          |          5  t          |d           d d d            n# 1 swxY w Y   t	          j        t          |          5  t          |d	         d           d d d            n# 1 swxY w Y   d}t	          j        t          |          5  t          |                              d           d d d            n# 1 swxY w Y   t	          j        t          |          5  t          |d	                                       d           d d d            d S # 1 swxY w Y   d S )
NrT   r]  z)Trying to coerce float values to integersrj   rl   r<   r  ri   r   )r>   r)  r*  r  rq   rr   r   r   roundr4  r{  rp   r   r    rB   )rF   rG   rs   rH   s       rJ   "test_floating_values_integer_dtypezLTestDataFrameConstructorWithDtypeCoercion.test_floating_values_integer_dtype2  s    i##A&&66w??
 :]:S111 	' 	'c&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' syy{{$///	T!&&((((( FD	J]-S999 	' 	'c&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	']-S999 	' 	'3q6&&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' K]-S999 	( 	(cNN!!$'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(]-S999 	( 	(3q6NN!!$'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(sZ   A..A25A2'DD	D	+EEE7#F&&F*-F*)HH	HN)r  r  r  r  r   rL   rJ   r  r  1  s#        ( ( ( ( (rL   r  c                      e Zd Zej                            dddg          d             Zej                            dddg          d             Zd	 Zd
 Z	d Z
d Zd Zd Zd Zd Zd Zej                            deeg          d             Zd Zd Zd Zej                            e d          ej                            dg dg dg ddg          d                         ZdS )&TestDataFrameConstructorWithDatetimeTZrS   rW  zdateutil/US/Easternc                 "   t          ddd          }|                    |          }t          d|d|          }t          d|j                  }|d	         j        |k    sJ d
 |D             }d |D             }t          d|i          }||d<   ||d<   ||d<   |j        }t          t          j        d          t          |          t          j        d          t          |          gg d          }	t          j
        ||	           d S )N2011/1/12012/1/1W-FRIrK  r   rx  rb   r`   r{   c                 6    g | ]}|                                 S r   r{  r}  s     rJ   r   zeTestDataFrameConstructorWithDatetimeTZ.test_construction_preserves_tzaware_dtypes.<locals>.<listcomp>]  s$    ;;;"2++--;;;rL   c                 6    g | ]}|                                 S r   r{  r}  s     rJ   r   zeTestDataFrameConstructorWithDatetimeTZ.test_construction_preserves_tzaware_dtypes.<locals>.<listcomp>^  s$    @@@BR--//@@@rL   r  dr_tzdatetimes_naivedatetimes_with_tzr  rX  )r  r  r  r  )r$   r}   r   r   tzinfor=   r4  r    r>   rD   r   )
rF   rS   r  r  rH   tz_expectedr  r  r   rI   s
             rJ   *test_construction_preserves_tzaware_dtypeszQTestDataFrameConstructorWithDatetimeTZ.test_construction_preserves_tzaware_dtypesR  sC    
JW===r""U//r:::%dEL99#w}++++ <;;;;@@%@@@bz""7 /"3)**2&&&)**2&&&	 JII
 
 
 	vx00000rL   pydtTFc                    |}t          d|          }|r|                                }d}t          j        t          |          5  t          d|gid           d d d            n# 1 swxY w Y   d}t          j        t          |          5  t          d|idgd	           d d d            n# 1 swxY w Y   t          j        t          |          5  t          |gd           d d d            n# 1 swxY w Y   t          j        t          |          5  t          t          j        |gt                    d           d d d            n# 1 swxY w Y   t          j        t          |          5  t          |dgdgd
           d d d            n# 1 swxY w Y   t          j        t          |          5  t          t          |g          gd           d d d            n# 1 swxY w Y   t          j        t          |          5  t          |ggdgd           d d d            d S # 1 swxY w Y   d S )N2019rX  sCannot convert timezone-aware data to timezone-naive dtype. Use pd.Series\(values\).dt.tz_localize\(None\) instead.rj   r   r  r<   /Cannot unbox tzaware Timestamp to tznaive dtyper^  r  rf  )r"   r|  rq   rr   r   r   r   r>   ro   rC   r    )rF   tz_aware_fixturer  rS   r~  rs   msg2s          rJ   'test_constructor_data_aware_dtype_naivezNTestDataFrameConstructorWithDatetimeTZ.test_constructor_data_aware_dtype_naiveo  sV    v"%%% 	$!!##BG 	 ]:S111 	9 	9q2$i'78888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 A]9D111 	B 	Bq"gaS0@AAAA	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B ]:S111 	4 	4rd"23333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 ]:S111 	L 	Lbht6222:JKKKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L ]9D111 	J 	JbaS8HIIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J ]:S111 	> 	>vrd||n,<====	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> ]:S111 	C 	Ctfqc1ABBBB	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	Cs~   A((A,/A,B22B69B6C77C;>C;,EEE;FF!$F!!G00G47G4H99H= H=c                    t          t          ddd          d          }t          dd          }t          ||d	          }|d
         j        s
J d            |d
         j        d
k    sJ t          j        |d
         t          |d
                     t          j        |d         t          |d                     d S )Nr  r;   rW  rQ   r   r|   20130110rr  rx  r  zM8[ns, US/Easternr{   )r   r$   r   r=   rn   rD   r   r    )rF   r   r  rH   s       rJ   test_from_dictz5TestDataFrameConstructorWithDatetimeTZ.test_from_dict  s     Jz1FFFUSSS
A... Sr**++#w}111111#w|s""""
r#ws(=(=(=>>>
r#wr(<(<(<=====rL   c                 L   t          dddd          }t          |          }t          j        |d         t	          |d                     t          t	          |                    }t          j        |d         t	          |d                     t          ddd          }t          |          }t          j        |d         t	          |d                     t          t	          |                    }t          j        |d         t	          |d                     d S )	Nr  r;   rW  r   )rR   rS   rn   r|   rQ   r   )r$   r   rD   r   r    )rF   rD  r  s      rJ   test_from_indexz6TestDataFrameConstructorWithDatetimeTZ.test_from_index  s    *aLuMMMoo
s5z6$U+C+C+CDDDt%%
s5z6$U+C+C+CDDD*aLAAAoo
s1vvd';';';<<<t%%
s1vvd';';';<<<<<rL   c                     t          dd          }t          ||          }t          d|d|           t          d|j        d|           d S )Nr  r(  rr  rb   r   r9  )r$   r    r   r  )rF   r  r)  s      rJ   +test_frame_dict_constructor_datetime64_1680zRTestDataFrameConstructorWithDatetimeTZ.test_frame_dict_constructor_datetime64_1680  sf    
B///2R    	A&&b1111AH--R888888rL   c                     t          ddd          }t          |          }t          d|d|          }|d                                                                         sJ d S )	Nr  r  r  rK  r   rx  rb   r{   )r$   r    r   r%   r{  )rF   r  r~  r   s       rJ   +test_frame_datetime64_mixed_index_ctor_1681zRTestDataFrameConstructorWithDatetimeTZ.test_frame_datetime64_mixed_index_ctor_1681  sg    
JW===BZZ E++2666v{{}}  """""""rL   c           	          t          dddd          }t          |dg          }t          dt          dd          t          d	d          t          d
d          gi          }t          j        ||           d S )Nz20130101T10:00:00r;   minrW  )ry  rR   rL  rS   
timestampsr   rX  z20130101T10:01:00z20130101T10:02:00)r$   r   r"   rD   rE   )rF   r  r   rI   s       rJ   test_frame_timeseries_columnzCTestDataFrameConstructorWithDatetimeTZ.test_frame_timeseries_column  s    %qu
 
 
 2~6661lCCC1lCCC1lCCC
 
 	fh/////rL   c                     ddg}ddddddd	d
}t          |g d|          }t          ddt          j        t          j        fg|t          g d                    }t	          j        ||           d S )NNevadaOhio333333@333333@)rn    r  333333?@)r  rn  r  )r  r  )rn  r  i  r   )r  r  )r  r  r  )r   r>   rp   r   rD   rE   )rF   r   popr   rI   s        rJ   test_nested_dict_constructionzDTestDataFrameConstructorWithDatetimeTZ.test_nested_dict_construction  s    V$ ,,c55
 
 3&8&8&8'JJJbfbf%56***++
 
 

 	fh/////rL   c                 h   t          ddd          }|j                            t                                        dd          }t          |          }|j        dk    sJ |j        |j        k    	                                sJ ||k    	                                	                                sJ d S )Nz2016-04-05 04:30r;   r  rQ   rU   rC  rP  )
r$   rW   rB   rC   r@   r   r|  r4  r=   r{  )rF   r\   r   rH   s       rJ   test_from_tzaware_object_arrayzETestDataFrameConstructorWithDatetimeTZ.test_from_tzaware_object_array  s    +Q5AAAy''//266t__x6!!!!	SY&++-----c	  $$&&&&&&&rL   c           
         t          j        t          d          t          d          t          d          gt          dd          t          j        t          dd          gt          dd	          t          j        t          d
d	          ggt
                    j        }t          |g d          }g d}|j        |k    	                                sJ d S )Nz2013-01-01 00:00:00z2013-01-02 00:00:00z2013-01-03 00:00:00z2013-01-01 00:00:00-0500rW  rX  z2013-01-03 00:00:00-0500z2013-01-01 00:00:00+0100CETz2013-01-03 00:00:00+0100r<   r#  r   )r  r  zdatetime64[ns, CET])
r>   ro   r"   rM  r   rC   r!  r   r4  r{  )rF   rG   r  expected_dtypess       rJ   $test_from_tzaware_mixed_object_arrayzKTestDataFrameConstructorWithDatetimeTZ.test_from_tzaware_mixed_object_array  s   h 344344344 8\JJJF8\JJJ 8UCCCF8UCCC" %
 
 
& ' 	( ___555
 
 

 
o-224444444rL   c                     t          j        d                              d          }t          |d          }t          |                              d          }t          j        ||           d S )Nr(  )r   rT   zdatetime64[ns, UTC]r<   )r>   r?   r@   r   rB   rD   rE   )rF   
array_dim2rH   rI   s       rJ   test_from_2d_ndarray_with_dtypezFTestDataFrameConstructorWithDatetimeTZ.test_from_2d_ndarray_with_dtype  se    Yr]]**622
z)>???Z((//0EFF
b(+++++rL   r5  c                 D    |h d          }d|j          d}t          j        t          |          5  t	          d|i           d d d            n# 1 swxY w Y   t          j        t          |          5  t          |           d d d            d S # 1 swxY w Y   d S )N>   rU   rT   r;   'z' type is unorderedrj   r   )r  rq   rr   r   r   r    )rF   r5  r  rs   s       rJ   !test_construction_from_set_raiseszHTestDataFrameConstructorWithDatetimeTZ.test_construction_from_set_raises  s)    YYY3#,333]9C000 	% 	%sFm$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% ]9C000 	 	6NNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s#   AAA8BBBc                     t          j        ddd                              dd          }t          |          }t	          d |j        j        D                       sJ d S )Nr   r9   r  r<   r:   r;   c              3   @   K   | ]}t          |t                    V  d S r   )r   r&   )r   rG   s     rJ   r   zeTestDataFrameConstructorWithDatetimeTZ.test_construction_from_ndarray_datetimelike.<locals>.<genexpr>  s,      LLc:c=11LLLLLLrL   )r>   r?   r@   r   r{  rY   r   r  s      rJ   +test_construction_from_ndarray_datetimelikezRTestDataFrameConstructorWithDatetimeTZ.test_construction_from_ndarray_datetimelike  sc     i2%5666>>q!DDs^^LLRW^LLLLLLLLLLrL   c                    t           j                            d                              d          }t	          j        dg          j        }d}t          j        t          |          5  t          |dg|           d d d            n# 1 swxY w Y   t	          j        g d          }t          j        t          |          5  t          |dd	g
           d d d            d S # 1 swxY w Y   d S )NrT   r  r   z'len\(arrays\) must match len\(columns\)rj   r   rf  )r   r   r  r"  r   )r>   r)  r*  r  rM  ro   r=   rq   rr   r   r   )rF   rG   r=   rs   arr2s        rJ   >test_construction_from_ndarray_with_eadtype_mismatched_columnszeTestDataFrameConstructorWithDatetimeTZ.test_construction_from_ndarray_with_eadtype_mismatched_columns  sb   i##A&&66w??#%8]:S111 	9 	9cE7%8888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 x((]:S111 	4 	4dUEN3333	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4s$   *B

BBC''C+.C+c                 0   g dg dg}t          j        t          d          5  t          |ddh           d d d            n# 1 swxY w Y   t          j        t          d          5  t          |h d	
           d d d            d S # 1 swxY w Y   d S )Nr  r  zindex cannot be a setrj   r   r   rb   zcolumns cannot be a set>   r   r   r   r   r  ry  s     rJ   "test_columns_indexes_raise_on_setszITestDataFrameConstructorWithDatetimeTZ.test_columns_indexes_raise_on_sets*  s'   		999%]:-DEEE 	. 	.d3*----	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	. 	.]:-FGGG 	5 	5dOOO4444	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5 	5s#   AAA*BBBz/StringDType only available in numpy 2 and abover  r   r   )r   r   r   r  c                    ddl m} t          j        |d          |                      |d<   t	          |          }|d         j        t          j        k    sJ |d         |d         k                                    sJ d S )Nr   )StringDTyper   r<   )numpy.dtypesr  r>   ro   r   r=   r   r{  )rF   r   r  r  s       rJ    test_np_string_array_object_castzGTestDataFrameConstructorWithDatetimeTZ.test_np_string_array_object_cast3  s     	-,,,,,HT#Ykkmm<<<S	oo3x~++++CDI%**,,,,,,,rL   N)r  r  r  rq   rw  rx  r  r  r  r  r  r  r  r  r  r  r  set	frozensetr  r  r  r  skipifr   r  r   rL   rJ   r  r  Q  s       [TL2G#HII1 1 JI18 [VdE]33C C 43CB> > >= = =9 9 9# # #0 0 0"0 0 0' ' '5 5 5>, , , [US)$455  65M M M	4 	4 	45 5 5 [#T    [!//oooNN	
 - -  - - -rL   r  c                 `    t          | t                    r| j        d         S | j        d         S )Nr   r  )r   r    r  r2  s    rJ   get1r  E  s,    #v x{x~rL   c                      e Zd Z ej        eedg          d             Zej        d             Zej	        
                    dddg          d             Zd	 Zd
 Zd Zej	        
                    dej        ej        g          d             Zej	        
                    deej        g          d             Zej	        j        d             Zej	        
                    deej        g          d             Zej	        j        ej	        
                    dej        ej        g          d                         Zd ZdS )TestFromScalarNparamsc                     |j         S r   paramrF   r  s     rJ   boxzTestFromScalar.boxM  
    }rL   c                     dt          d          it          u rdgd<   |t          j        fi S |t          u rt
          u rfdS fdS t
          u rfdS fdS )	Nrc   rT   r  r   c                       | | dfi |S )NrV   r   r   kwargsextrar   s     rJ   r   z,TestFromScalar.constructor.<locals>.<lambda>\  s1    ??aLL, ,$),-3, , rL   c                      d| ifi |S Nr  r   r  s     rJ   r   z,TestFromScalar.constructor.<locals>.<lambda>`  s#    ??C8+W+Wu+WPV+W+W rL   c                      | | gfi |S r   r   r  s     rJ   r   z,TestFromScalar.constructor.<locals>.<lambda>b  s"    1v'Q'Q'Q&'Q'Q rL   c                 "     d| | gifi |S r   r   r  s     rJ   r   z,TestFromScalar.constructor.<locals>.<lambda>d  s'    aV}'X'X'XQW'X'X rL   )r   r   	functoolspartialr3  r    )rF   r   r  r  s    ` @rJ   r   zTestFromScalar.constructorQ  s    %((#i'' #uE);$_>>>>>D[[&((      XWWWWW&&QQQQQQXXXXXXrL   r=   rv   r   c                      |t           j        |          }t          j        |j        |k              sJ t          j        |                                          sJ d S r  )rM  r   r>   r{  r4  r%   )rF   r=   r   r   s       rJ   test_from_nat_scalarz#TestFromScalar.test_from_nat_scalarf  sY    k"&...vcjE)*****vchhjj!!!!!!!rL   c                 h    t          d          } ||d          }t          |          |k    sJ d S )NrU   r   r<   r!   r  )rF   r   rG  r   s       rJ   *test_from_timedelta_scalar_preserves_nanosz9TestFromScalar.test_from_timedelta_scalar_preserves_nanosl  s8    q\\k"H---CyyBrL   c                 n    |t          d          z   } ||d          }t          |          |k    sJ d S )NrU   rv   r<   r  )rF   r   fixed_now_tsr~  r   s        rJ   *test_from_timestamp_scalar_preserves_nanosz9TestFromScalar.test_from_timestamp_scalar_preserves_nanosr  s=    IaLL(k"H---CyyBrL   c                     t          d          } |j                    } ||t                    }t          t	          |          t
          j                  sJ d S )NrU   r<   )r!   to_timedelta64rC   r   r  r>   r;  )rF   r   rG  td64r   s        rJ   #test_from_timedelta64_scalar_objectz2TestFromScalar.test_from_timedelta64_scalar_objectx  sU    q\\ r ""k$f---$s))R^4444444rL   clsc                     |dd          }t           j        dt           j        di|         }|t           j        u rd}nd}d                    d|g          }t	          j        t          |	          5   |||
           d d d            n# 1 swxY w Y    |dd          }t	          j        t          |	          5   |||
           d d d            d S # 1 swxY w Y   d S )Nr   r`   r   rv   r   z:<class 'numpy.timedelta64'> is not convertible to datetime|r  rj   r<   r:   )r>   r   r;  joinrq   rr   r   )rF   r   r  r  r=   msg1rs   s          rJ   (test_from_scalar_datetimelike_mismatchedz7TestFromScalar.test_from_scalar_datetimelike_mismatched  sw   UD!!".(CCH"-RDDODhht,--]9C000 	- 	-Ke,,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- Q]9C000 	- 	-Ke,,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-s$   2BBB>CC Cc                    |t           u s|t          u r?|t          u r6t          j                            dd          }|                    |           t          ddd          }d}|t          j	        u rt          j	        |d          }d} ||          }	t          |	          }
t          j        |	          }t          |
          t          u sJ |
j        j        |k    sJ ||k    sJ d S )	NziTimestamp constructor has been updated to cast dt64 to non-nano, but DatetimeArray._from_sequence has notTr  strict'  rU   rq  r  rp  )rE  r    r3  rq   rw  rz  applymarkerr
   r>   r   r  rD   	get_dtyperC  r"   asm8r=   rF   r   r  r  r  r   rw  r  r  r   itemr=   s               rJ   #test_from_out_of_bounds_ns_datetimez2TestFromScalar.test_from_out_of_bounds_ns_datetime  s    
 $;;?f44;$$E %  D
 %%%$1%%	"-]63//FIV$$F||V$$DzzY&&&&y)++++	!!!!!!rL   c                 "   t          j        t          j        t           j                  j        d          } ||          }t          |          }t          |          t           j        u sJ t          j        |          }|t          k    sJ d S r:  )
r>   r   iinfor5   maxr  rC  rD   r  rC   )rF   r   r  r   r  r=   s         rJ   test_out_of_s_bounds_datetime64z.TestFromScalar.test_out_of_s_bounds_datetime64  su    rx115s;;V$$F||DzzR]****V$$rL   c                    |t           u s|t          u r?|t          u r6t          j                            dd          }|                    |           t          ddd          t          ddd          z
  }d}|t          j	        u rt          j	        |d          }d	} ||          }	t          |	          }
t          j        |	          }t          |
          t          u sJ |
j        j        |k    sJ ||k    sJ d S )
NzoTimedeltaArray constructor has been updated to cast td64 to non-nano, but TimedeltaArray._from_sequence has notTr  r  rU   i  zm8[us]r  zm8[s])rE  r    r3  rq   rw  rz  r  r
   r>   r;  r  rD   r  rC  r!   r  r=   r  s               rJ   $test_from_out_of_bounds_ns_timedeltaz3TestFromScalar.test_from_out_of_bounds_ns_timedelta  s   
 $;;?f44;$$I %  D
 %%%$1%%q!(<(<<	".  ^FC00FIV$$F||V$$DzzY&&&&y)++++	!!!!!!rL   c                      |t          j        t           j                  j        d          } ||          }t	          |          }t          |          |u sJ t          j        |          }|t          k    sJ d S r:  )	r>   r"  r5   r#  r  rC  rD   r  rC   )rF   r   r  r  r   r  r=   s          rJ    test_out_of_s_bounds_timedelta64z/TestFromScalar.test_out_of_s_bounds_timedelta64  su     RXbh''+S11V$$F||DzzS    V$$rL   c                     d}t          d|          }||t          u r|t          u r
d}t          }n	d}t          }t          j        ||          5   ||d           d d d            d S # 1 swxY w Y   d S )	NrW  r  rX  r  r  rj   rv   r<   )r"   r   r3  r   r   rq   rr   )rF   r   r  r   rS   r~  rs   errs           rJ   test_tzaware_data_tznaive_dtypez.TestFromScalar.test_tzaware_data_tznaive_dtype  s    v"%%%;?i77C4KKCCCCK  C]3c*** 	, 	,K(++++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,s   A,,A03A0)r  r  r  rq   fixturerE  r3  r  r   rw  rx  r  r	  r  r  r>   r   r;  r  r
   r   
skip_ubsanr$  r   r&  r(  r+  r   rL   rJ   r  r  L  s       V^D$-...  /. ^Y Y ^Y( [Wx&:;;" " <;"
    5 5 5 [UR]BN$CDD- - ED-" [UXr}$=>>" " ?>"6 [   [UY$?@@" " A@"4 [[UR]BN$CDD  ED , , , , ,rL   r  c                       e Zd Z ej        ddg          d             Zej        d             Zd Zd Zd Z	d	 Z
d
 ZdS )TestAllowNonNanoTFr  c                     |j         S r   r  r  s     rJ   as_tdzTestAllowNonNano.as_td  r  rL   c                    t          j        d                              t           j                                      d          }|r&||d         z
  }t          j        ||j                  S t          j        ||j                  S )Nr   rp  r   r<   )	r>   r?   rB   r5   r   r*   _simple_newr=   r&   )rF   r1  r  s      rJ   rG   zTestAllowNonNano.arr  st    1$$RX..33G<< 	IfQi'F!-fFLIIII ,V6<HHHHrL   c                 H    t          |          }|j        |j        k    sJ d S r   )r   r=   )rF   rG   r   s      rJ   test_index_allow_non_nanoz*TestAllowNonNano.test_index_allow_non_nano  s(    CjjyCI%%%%%%rL   c                 v    |rt          j        |          }nt          |          }|j        |j        k    sJ d S r   )rM  TimedeltaIndexr   r=   )rF   rG   r1  r   s       rJ   test_dti_tdi_allow_non_nanoz,TestAllowNonNano.test_dti_tdi_allow_non_nano  sD     	%#C((CC$$CyCI%%%%%%rL   c                 H    t          |          }|j        |j        k    sJ d S r   )r    r=   )rF   rG   r  s      rJ   test_series_allow_non_nanoz+TestAllowNonNano.test_series_allow_non_nano
  s(    SkkyCI%%%%%%rL   c                 T    t          |          }|j        d         |j        k    sJ d S r   r   r4  r=   r  s      rJ   test_frame_allow_non_nanoz*TestAllowNonNano.test_frame_allow_non_nano  s,    s^^y|sy((((((rL   c                 X    t          d|i          }|j        d         |j        k    sJ d S r   r<  r  s      rJ   #test_frame_from_dict_allow_non_nanoz4TestAllowNonNano.test_frame_from_dict_allow_non_nano  s2    3x  y|sy((((((rL   N)r  r  r  rq   r,  r1  rG   r5  r8  r:  r=  r?  r   rL   rJ   r/  r/    s         V^D%=)))  *) ^I I ^I& & && & && & &) ) )) ) ) ) )rL   r/  )Lro   collectionsr   r   r   r   collections.abcr   dataclassesr   r
   r	   r   r  r'  numpyr>   r   numpy.mar   rq   r  pandas._configr   pandas._libsr   pandas.compat.numpyr   pandas.errorsr   pandas.util._test_decoratorsutil_test_decoratorsrG  pandas.core.dtypes.commonr   pandas.core.dtypes.dtypesr   r   r   r   pandasrM  r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   pandas._testing_testingrD   pandas.arraysr&   r'   r(   r)   r*   r0  r/  r7   r  r  r  r  r  r/  r   rL   rJ   <module>rR     s               % $ $ $ $ $ & & & & & &         
     				                   5 5 5 5 5 5       . . . . . . , , , , , , ) ) ) ) ) ) ) ) ) 6 6 6 6 6 6                                                "                    766 	 	 	 T*3 T*3 T*3 T*3 T*3 T*3 T*3 T*3nTH0 H0 H0 H0 H0 H0 H0 H0V( ( ( ( ( ( ( (@q- q- q- q- q- q- q- q-h  ^, ^, ^, ^, ^, ^, ^, ^,D&) &) &) &) &) &) &) &) &) &)rL   