Skip to content

docstring and whitespace cleanup #21719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/_libs/groupby.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def group_shift_indexer(ndarray[int64_t] out, ndarray[int64_t] labels,
label_indexer = np.zeros((ngroups, periods), dtype=np.int64)
with nogil:
for i in range(N):
## reverse iterator if shifting backwards
# reverse iterator if shifting backwards
ii = offset + sign * i
lab = labels[ii]

Expand Down
21 changes: 14 additions & 7 deletions pandas/_libs/tslibs/conversion.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ cdef _TSObject convert_str_to_tsobject(object ts, object tz, object unit,
cdef inline check_overflows(_TSObject obj):
"""
Check that we haven't silently overflowed in timezone conversion

Parameters
----------
obj : _TSObject
Expand Down Expand Up @@ -577,8 +577,6 @@ cdef inline datetime _localize_pydatetime(datetime dt, tzinfo tz):
except AttributeError:
return dt.replace(tzinfo=tz)

# ----------------------------------------------------------------------
# Timezone Conversion

cpdef inline datetime localize_pydatetime(datetime dt, object tz):
"""
Expand Down Expand Up @@ -607,6 +605,9 @@ cpdef inline datetime localize_pydatetime(datetime dt, object tz):
return dt.replace(tzinfo=tz)


# ----------------------------------------------------------------------
# Timezone Conversion

cdef inline int64_t tz_convert_tzlocal_to_utc(int64_t val, tzinfo tz):
"""
Parameters
Expand Down Expand Up @@ -682,10 +683,8 @@ cpdef int64_t tz_convert_single(int64_t val, object tz1, object tz2):

Returns
-------
int64 converted

converted: int64
"""

cdef:
ndarray[int64_t] trans, deltas
Py_ssize_t pos
Expand Down Expand Up @@ -840,9 +839,17 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
Localize tzinfo-naive i8 to given time zone (using pytz). If
there are ambiguities in the values, raise AmbiguousTimeError.

Parameters
----------
vals : ndarray[int64_t]
tz : tzinfo or None
ambiguous : str, bool, or arraylike
If arraylike, must have the same length as vals
errors : {"raise", "coerce"}, default "raise"

Returns
-------
localized : DatetimeIndex
localized : ndarray[int64_t]
"""
cdef:
ndarray[int64_t] trans, deltas, idx_shifted
Expand Down