1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
U
®ý°dŸã@sVddlmZddlZddlZddlmZmZmZmZm    Z    ddl
m Z Gdd„dƒZ dS)é)ÚdatetimeN)ÚPeriodÚSeriesÚ
date_rangeÚ period_rangeÚ to_datetimec@s<eZdZdd„Zdd„Zdd„Zdd„Zd    d
„Zd d „Zd S)ÚTestCombineFirstc    Cs¤tdddd}ttdƒtdƒdd}||fD]r}tdtjtjdd    tjd
g|d }td d d d d d d g|d }| |¡}tdd d dd    d d
g|tjd }t     ||¡q,dS)Nz
1950-01-31z
1950-07-31ÚM)ÚstartÚendÚfreqz1950-1z1950-7éééé©Úindexé    ©rÚdtype)
rrrrÚnpÚnanÚ combine_firstÚfloat64ÚtmÚassert_series_equal)ÚselfZdidxZpidxÚidxÚaÚbÚresultÚexpected©r"úed:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\pandas/tests/series/methods/test_combine_first.pyÚ"test_combine_first_period_datetimes  
z3TestCombineFirst.test_combine_first_period_datetimecCs&| |dd…¡}|j|jks"t‚dS)Nr)rÚnameÚAssertionError)rZdatetime_seriesr r"r"r#Útest_combine_first_namesz(TestCombineFirst.test_combine_first_namec Csˆt d¡j t¡}t|t d¡d}|d}tj|ddd…<| |¡}t     ||¡| |¡}t 
|¡  ¡snt ‚t     |ddd…|ddd…¡t     |ddd…|ddd…¡t  d¡}ttj d¡|d}tt  d¡|ddd…d}| |¡}t     ||j|ddd…¡t     |ddd… t¡|j|ddd…¡tdddgdddgd}tggtd    }    | |    ¡}
|j d
¡|_t     ||
¡dS) Nérér é
gð?érrÚO)rZ makeIntIndexÚvaluesZastypeÚfloatrrÚNaNrrÚisfiniteÚallr&ZmakeStringIndexÚrandomZrandnÚlocÚobjectr) rr-ZseriesZ series_copyZcombinedrZfloatsÚstringsZserÚemptyr r"r"r#Útest_combine_first"s*
 
  
 
,
z#TestCombineFirst.test_combine_firstcCsœttdtjgƒƒ}tttjdgƒƒ}| |¡}ttddgƒƒ}t ||¡ttdtjgƒƒ}ttjdgƒ}| |¡}ttdddƒdgdd}t ||¡dS)NZ2010Z2011iÚr zdatetime64[ns])r)rrrr/rrrr)rÚs0Ús1ÚrsZxpr"r"r#Útest_combine_first_dt64Fs
 
z(TestCombineFirst.test_combine_first_dt64cCs~ttjdddg|ddd}ttjddd    g|dd
d d gd d}| |¡}tjddddd    g|d}t|dd}t ||¡dS)NZ20150101Z20150102Z20150103)ÚtzÚser1)r%Z20160514Z20160515Z20160516r)r+rÚser2)rr%)rÚpdZ DatetimeIndexrrr)rZtz_naive_fixturer=r>r Zexp_valsÚexpr"r"r#Útest_combine_first_dt_tz_valuesUs þý
 þ z0TestCombineFirst.test_combine_first_dt_tz_valuescCsXttddddƒtddddƒddd}ttdƒ|d}t|d}| |¡}t ||¡dS)Niår r*ÚHz Europe/Rome)r r<r)rrrÚrangerrr)rZ
time_indexr9Ús2r r"r"r#Ú4test_combine_first_timezone_series_with_empty_seriesgs  ü
 
zETestCombineFirst.test_combine_first_timezone_series_with_empty_seriesN)    Ú__name__Ú
__module__Ú __qualname__r$r'r7r;rArEr"r"r"r#rs  $r)rÚnumpyrZpandasr?rrrrrZpandas._testingZ_testingrrr"r"r"r#Ú<module>s