#NEWLINE# def test_representation_to_series( self ) : #NEWLINE# #INDENT# idx1 = DatetimeIndex ( [ ] , freq = 'D' ) #NEWLINE# idx2 = DatetimeIndex ( [ '2011-01-01' ] , freq = 'D' ) #NEWLINE# idx3 = DatetimeIndex ( [ '2011-01-01' , '2011-01-02' ] , freq = 'D' ) #NEWLINE# idx4 = DatetimeIndex ( [ '2011-01-01' , '2011-01-02' , '2011-01-03' ] , freq = 'D' ) #NEWLINE# idx5 = DatetimeIndex ( [ '2011-01-01 09:00' , '2011-01-01 10:00' , '2011-01-01 11:00' ] , freq = 'H' , tz = 'Asia/Tokyo' ) #NEWLINE# idx6 = DatetimeIndex ( [ '2011-01-01 09:00' , '2011-01-01 10:00' , pd . NaT ] , tz = 'US/Eastern' ) #NEWLINE# idx7 = DatetimeIndex ( [ '2011-01-01 09:00' , '2011-01-02 10:15' ] ) #NEWLINE# exp1 = 'Series([], dtype: datetime64[ns])' #NEWLINE# exp2 = '0   2011-01-01\ndtype: datetime64[ns]' #NEWLINE# exp3 = '0   2011-01-01\n1   2011-01-02\ndtype: datetime64[ns]' #NEWLINE# exp4 = '0   2011-01-01\n1   2011-01-02\n2   2011-01-03\ndtype: datetime64[ns]' #NEWLINE# exp5 = '0   2011-01-01 09:00:00+09:00\n1   2011-01-01 10:00:00+09:00\n2   2011-01-01 11:00:00+09:00\ndtype: datetime64[ns, Asia/Tokyo]' #NEWLINE# exp6 = '0   2011-01-01 09:00:00-05:00\n1   2011-01-01 10:00:00-05:00\n2                         NaT\ndtype: datetime64[ns, US/Eastern]' #NEWLINE# exp7 = '0   2011-01-01 09:00:00\n1   2011-01-02 10:15:00\ndtype: datetime64[ns]' #NEWLINE# with pd . option_context ( 'display.width' , 300 ) : #NEWLINE# #INDENT# for ( idx , expected ) in zip ( [ idx1 , idx2 , idx3 , idx4 , idx5 , idx6 , idx7 ] , [ exp1 , exp2 , exp3 , exp4 , expected , exp6 , exp7 ] ) : #NEWLINE# #INDENT# result = repr ( Series ( idx ) ) #NEWLINE# self . assertEqual ( result , expected )