@@ -608,36 +608,36 @@ datatypes would yield different return types. These are now made consistent. (:i
608608 .. code-block:: ipython
609609
610610 # Series
611- In [5]: Series( pd.Index ([pd.Timestamp('20160101', tz='US/Eastern'),
612- pd.Timestamp('20160101', tz='US/Eastern')]) ).unique()
611+ In [5]: pd.Series ([pd.Timestamp('20160101', tz='US/Eastern'),
612+ pd.Timestamp('20160101', tz='US/Eastern')]).unique()
613613 Out[5]: array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')], dtype=object)
614614
615- In [6]: pd.unique(Series( pd.Index ([pd.Timestamp('20160101', tz='US/Eastern'),
616- pd.Timestamp('20160101', tz='US/Eastern')]) ))
615+ In [6]: pd.unique(pd.Series ([pd.Timestamp('20160101', tz='US/Eastern'),
616+ pd.Timestamp('20160101', tz='US/Eastern')]))
617617 Out[6]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
618618
619619 # Index
620620 In [7]: pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
621621 pd.Timestamp('20160101', tz='US/Eastern')]).unique()
622622 Out[7]: DatetimeIndex(['2016-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq=None)
623623
624- In [8]: pd.unique(pd.Index( [pd.Timestamp('20160101', tz='US/Eastern'),
625- pd.Timestamp('20160101', tz='US/Eastern')]) )
624+ In [8]: pd.unique([pd.Timestamp('20160101', tz='US/Eastern'),
625+ pd.Timestamp('20160101', tz='US/Eastern')])
626626 Out[8]: array(['2016-01-01T05:00:00.000000000'], dtype='datetime64[ns]')
627627
628628 New Behavior:
629629
630630 .. ipython:: python
631631
632632 # Series, returns an array of Timestamp tz-aware
633- Series( pd.Index ([pd.Timestamp('20160101', tz='US/Eastern'),
634- pd.Timestamp('20160101', tz='US/Eastern')]) ).unique()
635- pd.unique(Series( pd.Index ([pd.Timestamp('20160101', tz='US/Eastern'),
636- pd.Timestamp('20160101', tz='US/Eastern')]) ))
633+ pd.Series ([pd.Timestamp('20160101', tz='US/Eastern'),
634+ pd.Timestamp('20160101', tz='US/Eastern')]).unique()
635+ pd.unique(pd.Series ([pd.Timestamp('20160101', tz='US/Eastern'),
636+ pd.Timestamp('20160101', tz='US/Eastern')]))
637637
638638 # Index, returns a DatetimeIndex
639639 pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
640- pd.Timestamp('20160101', tz='US/Eastern')])
640+ pd.Timestamp('20160101', tz='US/Eastern')]).unique()
641641 pd.unique(pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
642642 pd.Timestamp('20160101', tz='US/Eastern')]))
643643
@@ -647,21 +647,21 @@ datatypes would yield different return types. These are now made consistent. (:i
647647
648648 .. code-block:: ipython
649649
650- In [1]: pd.Series(pd.Categorical(list('aabc '))).unique()
650+ In [1]: pd.Series(pd.Categorical(list('baabc '))).unique()
651651 Out[1]:
652- [a, b , c]
653- Categories (3, object): [a, b , c]
652+ [b, a , c]
653+ Categories (3, object): [b, a , c]
654654
655- In [2]: pd.unique(pd.Series(pd.Categorical(list('aabc '))).unique( ))
656- Out[2]: array(['a ', 'b ', 'c'], dtype=object)
655+ In [2]: pd.unique(pd.Series(pd.Categorical(list('baabc '))))
656+ Out[2]: array(['b ', 'a ', 'c'], dtype=object)
657657
658658 New Behavior:
659659
660660 .. ipython:: python
661661
662662 # returns a Categorical
663- pd.Series(pd.Categorical(list('aabc '))).unique()
664- pd.unique(pd.Series(pd.Categorical(list('aabc '))).unique())
663+ pd.Series(pd.Categorical(list('baabc '))).unique()
664+ pd.unique(pd.Series(pd.Categorical(list('baabc '))).unique())
665665
666666.. _whatsnew_0200.api_breaking.s3:
667667
0 commit comments