@@ -381,13 +381,15 @@ def unique(values):
381
381
382
382
>>> pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
383
383
... pd.Timestamp('20160101', tz='US/Eastern')]))
384
- array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')],
385
- dtype=object)
384
+ <DatetimeArray>
385
+ ['2016-01-01 00:00:00-05:00']
386
+ Length: 1, dtype: datetime64[ns, US/Eastern]
386
387
387
388
>>> pd.unique(pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
388
389
... pd.Timestamp('20160101', tz='US/Eastern')]))
389
390
DatetimeIndex(['2016-01-01 00:00:00-05:00'],
390
- ... dtype='datetime64[ns, US/Eastern]', freq=None)
391
+ dtype='datetime64[ns, US/Eastern]',
392
+ freq=None)
391
393
392
394
>>> pd.unique(list('baabc'))
393
395
array(['b', 'a', 'c'], dtype=object)
@@ -396,21 +398,21 @@ def unique(values):
396
398
order of appearance.
397
399
398
400
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'))))
399
- [b, a, c ]
400
- Categories (3, object): [b, a, c ]
401
+ ['b', 'a', 'c' ]
402
+ Categories (3, object): ['b', 'a', 'c' ]
401
403
402
404
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'),
403
405
... categories=list('abc'))))
404
- [b, a, c ]
405
- Categories (3, object): [b, a, c ]
406
+ ['b', 'a', 'c' ]
407
+ Categories (3, object): ['b', 'a', 'c' ]
406
408
407
409
An ordered Categorical preserves the category ordering.
408
410
409
411
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'),
410
412
... categories=list('abc'),
411
413
... ordered=True)))
412
- [b, a, c ]
413
- Categories (3, object): [a < b < c ]
414
+ ['b', 'a', 'c' ]
415
+ Categories (3, object): ['a' < 'b' < 'c' ]
414
416
415
417
An array of tuples
416
418
0 commit comments