Skip to content

Commit

Permalink
BUG: group_shift_indexer checks for null group keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ivannz committed Jul 29, 2016
1 parent 2c55f28 commit 966d5c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pandas/src/algos_groupby_helper.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -1356,6 +1356,11 @@ def group_shift_indexer(int64_t[:] out, int64_t[:] labels,
## reverse iterator if shifting backwards
ii = offset + sign * i
lab = labels[ii]

# Skip null keys
if lab == -1:
continue

label_seen[lab] += 1

idxer_slot = label_seen[lab] % periods
Expand Down

0 comments on commit 966d5c6

Please sign in to comment.