I have a large amount of data returned from a SQL query, then broken up into groups using itertools.groupby()
I need to skip over the first element of each group, then process the rest of them. Will calling next() on the group do this? I'm not very familiar with iterators being used this way.
for group in itertools.groupby(...):
group.next()
for val in group...
for val in group
is really just callinggroup.next()
until it getsStopIteration
anyway..next()
doesn't exist in Python 3; it's been renamed to.__next__()
. Either way, you should use thenext()
function instead of the method.