Skip to content

Commit 0cb0886

Browse files
jbrockmendeljreback
authored andcommitted
docstring and whitespace cleanup (pandas-dev#21719)
1 parent 0c2ab65 commit 0cb0886

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

pandas/_libs/groupby.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def group_shift_indexer(ndarray[int64_t] out, ndarray[int64_t] labels,
243243
label_indexer = np.zeros((ngroups, periods), dtype=np.int64)
244244
with nogil:
245245
for i in range(N):
246-
## reverse iterator if shifting backwards
246+
# reverse iterator if shifting backwards
247247
ii = offset + sign * i
248248
lab = labels[ii]
249249

pandas/_libs/tslibs/conversion.pyx

+14-7
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ cdef _TSObject convert_str_to_tsobject(object ts, object tz, object unit,
482482
cdef inline check_overflows(_TSObject obj):
483483
"""
484484
Check that we haven't silently overflowed in timezone conversion
485-
485+
486486
Parameters
487487
----------
488488
obj : _TSObject
@@ -577,8 +577,6 @@ cdef inline datetime _localize_pydatetime(datetime dt, tzinfo tz):
577577
except AttributeError:
578578
return dt.replace(tzinfo=tz)
579579

580-
# ----------------------------------------------------------------------
581-
# Timezone Conversion
582580

583581
cpdef inline datetime localize_pydatetime(datetime dt, object tz):
584582
"""
@@ -607,6 +605,9 @@ cpdef inline datetime localize_pydatetime(datetime dt, object tz):
607605
return dt.replace(tzinfo=tz)
608606

609607

608+
# ----------------------------------------------------------------------
609+
# Timezone Conversion
610+
610611
cdef inline int64_t tz_convert_tzlocal_to_utc(int64_t val, tzinfo tz):
611612
"""
612613
Parameters
@@ -682,10 +683,8 @@ cpdef int64_t tz_convert_single(int64_t val, object tz1, object tz2):
682683
683684
Returns
684685
-------
685-
int64 converted
686-
686+
converted: int64
687687
"""
688-
689688
cdef:
690689
ndarray[int64_t] trans, deltas
691690
Py_ssize_t pos
@@ -840,9 +839,17 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
840839
Localize tzinfo-naive i8 to given time zone (using pytz). If
841840
there are ambiguities in the values, raise AmbiguousTimeError.
842841
842+
Parameters
843+
----------
844+
vals : ndarray[int64_t]
845+
tz : tzinfo or None
846+
ambiguous : str, bool, or arraylike
847+
If arraylike, must have the same length as vals
848+
errors : {"raise", "coerce"}, default "raise"
849+
843850
Returns
844851
-------
845-
localized : DatetimeIndex
852+
localized : ndarray[int64_t]
846853
"""
847854
cdef:
848855
ndarray[int64_t] trans, deltas, idx_shifted

0 commit comments

Comments
 (0)