Skip to content

Commit 6adfead

Browse files
author
ShaharNaveh
committed
Revert "Applied "black formatting" on the example code"
This reverts commit bec5b3a.
1 parent bec5b3a commit 6adfead

File tree

1 file changed

+14
-26
lines changed

1 file changed

+14
-26
lines changed

pandas/core/algorithms.py

+14-26
Original file line numberDiff line numberDiff line change
@@ -375,60 +375,48 @@ def unique(values):
375375
>>> pd.unique(pd.Series([2] + [1] * 5))
376376
array([2, 1])
377377
378-
>>> pd.unique(pd.Series([pd.Timestamp("20160101"), pd.Timestamp("20160101")]))
378+
>>> pd.unique(pd.Series([pd.Timestamp('20160101'),
379+
... pd.Timestamp('20160101')]))
379380
array(['2016-01-01T00:00:00.000000000'], dtype='datetime64[ns]')
380381
381-
>>> pd.unique(
382-
... pd.Series(
383-
... [
384-
... pd.Timestamp("20160101", tz="US/Eastern"),
385-
... pd.Timestamp("20160101", tz="US/Eastern"),
386-
... ]
387-
... )
388-
... )
382+
>>> pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
383+
... pd.Timestamp('20160101', tz='US/Eastern')]))
389384
<DatetimeArray>
390385
['2016-01-01 00:00:00-05:00']
391386
Length: 1, dtype: datetime64[ns, US/Eastern]
392387
393-
>>> pd.unique(
394-
... pd.Index(
395-
... [
396-
... pd.Timestamp("20160101", tz="US/Eastern"),
397-
... pd.Timestamp("20160101", tz="US/Eastern"),
398-
... ]
399-
... )
400-
... )
388+
>>> pd.unique(pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
389+
... pd.Timestamp('20160101', tz='US/Eastern')]))
401390
DatetimeIndex(['2016-01-01 00:00:00-05:00'],
402391
dtype='datetime64[ns, US/Eastern]',
403392
freq=None)
404393
405-
>>> pd.unique(list("baabc"))
394+
>>> pd.unique(list('baabc'))
406395
array(['b', 'a', 'c'], dtype=object)
407396
408397
An unordered Categorical will return categories in the
409398
order of appearance.
410399
411-
>>> pd.unique(pd.Series(pd.Categorical(list("baabc"))))
400+
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'))))
412401
['b', 'a', 'c']
413402
Categories (3, object): ['a', 'b', 'c']
414403
415-
>>> pd.unique(pd.Series(pd.Categorical(list("baabc"), categories=list("abc"))))
404+
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'),
405+
... categories=list('abc'))))
416406
['b', 'a', 'c']
417407
Categories (3, object): ['a', 'b', 'c']
418408
419409
An ordered Categorical preserves the category ordering.
420410
421-
>>> pd.unique(
422-
... pd.Series(
423-
... pd.Categorical(list("baabc"), categories=list("abc"), ordered=True)
424-
... )
425-
... )
411+
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'),
412+
... categories=list('abc'),
413+
... ordered=True)))
426414
['b', 'a', 'c']
427415
Categories (3, object): ['a' < 'b' < 'c']
428416
429417
An array of tuples
430418
431-
>>> pd.unique([("a", "b"), ("b", "a"), ("a", "c"), ("b", "a")])
419+
>>> pd.unique([('a', 'b'), ('b', 'a'), ('a', 'c'), ('b', 'a')])
432420
array([('a', 'b'), ('b', 'a'), ('a', 'c')], dtype=object)
433421
"""
434422
values = _ensure_arraylike(values)

0 commit comments

Comments
 (0)