Skip to content

Commit 9399ec6

Browse files
author
ShaharNaveh
committed
Fix docs for algorithms.py
1 parent 4aeb8f2 commit 9399ec6

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

ci/code_checks.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ if [[ -z "$CHECK" || "$CHECK" == "doctests" ]]; then
138138

139139
# Individual files
140140

141+
MSG='Doctests algorithms.py' ; echo $MSG
142+
pytest -q --doctest-modules pandas/core/algorithms.py
143+
RET=$(($RET + $?)) ; echo $MSG "DONE"
144+
141145
MSG='Doctests accessor.py' ; echo $MSG
142146
pytest -q --doctest-modules pandas/core/accessor.py
143147
RET=$(($RET + $?)) ; echo $MSG "DONE"

pandas/core/algorithms.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,13 +381,15 @@ def unique(values):
381381
382382
>>> pd.unique(pd.Series([pd.Timestamp('20160101', tz='US/Eastern'),
383383
... 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]
386387
387388
>>> pd.unique(pd.Index([pd.Timestamp('20160101', tz='US/Eastern'),
388389
... pd.Timestamp('20160101', tz='US/Eastern')]))
389390
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)
391393
392394
>>> pd.unique(list('baabc'))
393395
array(['b', 'a', 'c'], dtype=object)
@@ -396,21 +398,21 @@ def unique(values):
396398
order of appearance.
397399
398400
>>> 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']
401403
402404
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'),
403405
... 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']
406408
407409
An ordered Categorical preserves the category ordering.
408410
409411
>>> pd.unique(pd.Series(pd.Categorical(list('baabc'),
410412
... categories=list('abc'),
411413
... ordered=True)))
412-
[b, a, c]
413-
Categories (3, object): [a < b < c]
414+
['b', 'a', 'c']
415+
Categories (3, object): ['a' < 'b' < 'c']
414416
415417
An array of tuples
416418

0 commit comments

Comments
 (0)