pythonlake.com

Search this site
  • Python
  • Download
  • Community
  • JS Tensorflow
  • Python
    • Boolean
      • if
      • while
      • str.isprintable()
      • str.isnumeric()
      • str.isalpha()
      • str.isdigit()
      • set.issuperset()
      • set.isdisjoint()
      • set.issubset()
      • Decimal.is_finite()
      • Decimal.is_normal()
      • Decimal.is_nan()
      • Decimal.is_nan()
      • Decimal.is_canonical()
      • Decimal.is_signed()
      • Decimal.is_subnormal()
      • Decimal().is_snan()
      • Decimal().is_infinite()
    • Built-in
      • abs()
      • bin()
      • bool()
      • bytearray()
      • chr()
      • complex()
      • count()
      • dir()
      • divmod()
      • enumerate()
      • float()
      • hex()
      • int()
      • input()
      • len()
      • max()
      • min()
      • ord()
      • range()
      • round()
      • pow()
      • print()
      • slice()
      • sorted
      • sum()
      • type()
    • Control Flow
      • break
      • continue
      • next
      • def
      • def main
      • except
      • for
      • if
      • lambda
      • pass
      • return
      • while
      • try
    • dict
      • dict.clear()
      • dict.copy()
      • dict.fromkeys()
      • dict.get()
      • dict.items()
      • dict.keys()
      • dict.pop()
      • dict.popitem()
      • dict.setdefault()
      • dict.update()
      • dict.values()
    • decimal
      • Decimal.adjusted()
      • Decimal.as_tuple()
      • Decimal.canonical()
      • Decimal.compare()
      • Decimal.compare_signal()
      • Decimal.compare_total()
      • Decimal.compare_total_mag()
      • Decimal.conjugate()
      • Decimal.copy_abs()
      • Decimal.copy_negate()
      • Decimal.copy_sign()
      • Decimal.exp()
      • Decimal.fma()
      • Decimal.from_float()
      • Decimal.imag()
      • Decimal.is_canonical()
      • Decimal.is_finite()
      • Decimal.is_nan()
      • Decimal.is_normal()
      • Decimal.is_qnan()
      • Decimal.is_signed()
      • decimal.Subnormal()
      • Decimal.is_zero()
      • Decimal.ln()
      • Decimal.log10()
      • Decimal.logb()
      • Decimal.logical_and()
      • Decimal.logical_invert()
      • Decimal.logical_or()
      • Decimal.logical_xor()
      • Decimal.max()
      • Decimal.max_mag()
      • Decimal.min_mag()
      • Decimal.next_plus()
      • Decimal.next_toward()
      • Decimal.normalize()
      • Decimal.number_class()
      • Decimal.quantize()
      • Decimal.radix()
      • Decimal.real()
      • Decimal.remainder_near()
      • Decimal.rotate()
      • Decimal.same_quantum()
      • Decimal.scaleb()
      • Decimal.shift()
      • Decimal.sqrt()
      • Decimal.to_eng_string()
      • Decimal.to_integral()
      • Decimal.to_integral_exact()
      • Decimal.to_integral_value()
    • django
      • django.core
        • validators
        • exceptions
      • django.conf
        • urls
          • url
      • django.contrib
      • django.db
      • django.forms
        • CharField
        • IntegerField
        • EmailField
        • ModelForm
      • django.http
        • HttpResponse
        • HttpResponseRedirect
      • django.shortcuts
    • frozenset
      • frozenset.copy()
      • frozenset.difference()
      • frozenset.intersection
      • frozenset.isdisjoint()
      • frozenset.issubset()
      • frozenset.issuperset()
      • frozenset.symmetric_difference()
      • frozenset.union()
    • fractions
      • fractions.Fraction()
      • fractions.gcd()
    • Fraction
      • Fraction.conjugate()
      • Fraction.denominator()
      • Fraction.from_decimal()
      • Fraction.from_float()
      • Fraction.imag()
      • Fraction.limit_denominator()
      • Fraction.numerator()
      • Fraction.real()
    • integer
      • int.bit_length()
      • int.conjugate()
      • int.denominator()
      • int.from_bytes()
      • int.imag()
      • int.numerator()
      • int.real()
      • int.to_bytes()
    • keywords
      • and
      • as
      • assert
      • break
      • class
      • continue
      • del
      • def
      • else
      • elif
      • exec
      • except
      • finally
      • for
      • from
      • global
      • if
      • import
      • in
      • is
      • lambda
      • not
      • or
      • pass
      • print()
      • raise
      • return
      • try
      • while
      • with
      • yield
    • list
      • list.append()
      • list.clear()
      • list.count()
      • list.copy()
      • list.extend()
      • list.insert()
      • list.reverse()
      • list.pop()
      • list.sort()
    • itertools
      • itertools.accumulate()
      • itertools.chain()
      • itertools.combinations()
      • itertools.combinations_with_replacement()
      • itertools.compress()
      • itertools.count()
      • itertools.cycle()
      • itertools.dropwhile()
      • itertools.filterfalse()
      • itertools.groupby()
      • itertools.islice()
      • itertools.permutations
      • itertools.product()
      • itertools.repeat()
      • itertools.starmap()
      • itertools.takewhile()
      • itertools.tee()
      • itertools.zip_longest()
    • map
      • map.__eq__()
      • map.__gt__()
      • map.__ge__()
      • map.__le__()
      • map.__lt__()
      • map.__ne__()
    • math
      • math.acos()
      • math.acosh()
      • math.asin()
      • math.asinh()
      • math.atan()
      • math.atan2()
      • math.atanh()
      • math.ceil()
      • math.copysign()
      • math.cos()
      • math.cosh()
      • math.e()
      • math.erf()
      • math.degrees()
      • math.exp()
      • math.expm1()
      • math.fabs()
      • math.factorial()
      • math.floor()
      • math.fmod()
      • math.frexp()
      • math.fsum()
      • math.gamma()
      • math.isfinite()
      • math.isinf()
      • math.ldexp()
      • math.log10()
      • math.log1p()
      • math.log()
      • math.log2()
      • math.modf()
      • math.pi
      • math.pow()
      • math.radians()
      • math.sin()
      • math.sinh()
      • math.sqrt()
      • math.tan()
      • math.tanh()
      • math.trunc()
    • operator
      • operator.abs()
      • operator.add()
      • operator.and_()
      • operator.concat()
      • operator.contains()
      • operator.delitem()
      • operator.eq()
      • operator.floordiv()
      • operator.ge()
      • operator.getitem()
      • operator.gt()
      • operator.iadd()
      • operator.iconcat()
      • operator.ifloordiv()
      • operator.ilshift()
      • operator.imod()
      • operator.imul()
      • operator.index()
      • operator.indexOf()
      • operator.inv()
      • operator.ipow()
      • operator.irshift()
      • operator.is_()
      • operator.isub()
      • operator.itruediv()
      • operator.ixor()
      • operator.length_hint()
      • operator.lshift()
      • operator.mod()
      • operator.mul()
      • operator.ne
      • operator.not_()
      • operator.or_()
      • operator.pos()
      • operator.sub()
      • operator.truediv()
      • operator.truth()
      • operator.xor()
    • pyramid
      • pyramid.config
        • Configurator
      • pyramid.response
        • Response
    • random
      • random.Random()
      • random.SystemRandom()
      • random.betavariate()
      • random.choice()
      • random.expovariate()
      • random.gammavariate()
      • random.gauss()
      • random.getrandbits()
      • random.getstate()
      • random.lognormvariate()
      • random.normalvariate()
      • random.paretovariate()
      • random.randint()
      • random.random()
      • random.randrange()
      • random.sample()
      • random.seed()
      • random.setstate()
      • random.shuffle()
      • random.triangular()
      • random.vonmisesvariate()
      • random.weibullvariate()
    • requests
      • requests.ConnectionError
      • requests.certs
      • requests.get
      • requests.HTTPError
      • requests.head
      • requests.get.headers
      • requests.get.text
      • requests.get.find
      • requests.get.parameters
      • requests.request
      • requests.status_codes
    • set
      • set.add()
      • set.clear()
      • set.difference()
      • set.difference_update()
      • set.intersection_update()
      • set.isdisjoint()
      • set.discard()
      • set.intersection()
      • set.issuperset()
      • set.issubset()
      • set.pop()
      • set.remove()
      • set.symmetric_difference()
      • set.symmetric_difference_update()
      • set.union()
      • set.update()
    • sqlite3
      • sqlite3.connect
    • str
      • str.capitalize()
      • str.casefold()
      • str.center()
      • str.count()
      • str.encode()
      • str.endswith()
      • str.expandtabs()
      • str.find()
      • str.format()
      • str.format_map()
      • str.index()
      • str.isalnum()
      • str.isalpha()
      • str.isdecimal()
      • str.isdigit()
      • str.isidentifier()
      • str.lower()
      • str.isnumeric()
      • str.isprintable()
      • str.isspace()
      • str.istitle()
      • str.isupper()
      • str.ljust()
      • str.join()
      • str.lstrip()
      • str.maketrans()
      • str.split()
      • str.partition()
      • str.partition()
      • str.splitlines()
      • str.replace()
      • str.rfind()
      • str.rstrip()
      • str.rindex()
      • str.rjust()
      • str.rpartition()
      • str.rsplit()
      • str.swapcase()
      • str.startswith()
      • str.translate()
      • str.upper()
      • str.zfill()
    • string constants
      • string.ascii_letters
      • string.ascii_lowercase
      • string.ascii_uppercase
      • string.ChainMap
      • string.digits
      • string.hexdigits
      • string.Template
      • string.octdigits
      • string.printable
      • string.whitespace
    • time
      • time.altzone
      • time.asctime
      • time.clock
      • time.ctime
      • time.daylight
      • time.get_clock_info
      • time.gmtime
      • time.localtime
      • time.monotonic
      • time.perf_counter
      • time.process_time
      • time.sleep
      • time.strftime
      • time.struct_time
      • time.time
      • time.timezone
      • time.tzname
    • tensorflow
      • Session
      • constant
      • equal
    • tuple
      • tuple.count()
      • tuple.index()
    • tkinter
      • tkinter.ARC
      • tkinter.BOTH
      • tkinter.BOTTOM
      • tkinter.Button
      • tkinter.button(text)
      • tkinter.button.pack
      • tkinter.Button(width)
      • tkinter.Button.grid
      • tkinter.Button.grid(column)
      • tkinter.Button.grid(columnspan)
      • tkinter.button(command)
      • tkinter.Button.grid(row)
      • tkinter.Button(fg)
      • tkinter.button.pack
      • tkinter.Button.destroy
      • tkinter.Canvas
      • tkinter.Canvas.create_line
      • tkinter.Canvas(height)
      • tkinter.Canvas(width)
      • tkinter.Canvas.bind
      • tkinter.Canvas.create_arc
      • tkinter.Canvas.create_oval
      • tkinter.Canvas.create_ovals(fill)
      • tkinter.Canvas.pack
      • tkinter.Checkbutton
      • tkinter.Checkbutton.grid
      • tkinter.Checkbutton.pack
      • tkinter.E
      • tkinter.Entry
      • tkinter.Entry.delete
      • tkinter.Entry.destroy
      • tkinter.Entry.grid
      • tkinter.Entry.get
      • tkinter.Entry.pack
      • tkinter.Entry.get
      • tkinter.Entry.set
      • tkinter.Entry(textvariable)
      • tkinter.Entry.grid(columnspan)
      • tkinter.Frame
      • tkinter.Frame.pack
      • tkinter.Frame(width)
      • tkinter.Frame(height)
      • tkinter.Frame(background)
      • tkinter.frame.bind
      • tkinter.Frame.pack
      • tkinter.Frame.grid
      • tkinter.LEFT
      • tkinter.Listbox
      • tkinter.Label
      • tkinter.Label(background)
      • tkinter.Label(fg)
      • tkinter.Label(text)
      • tkinter.Label.pack
      • tkinter.Label.grid
      • tkinter.LabelFrame
      • Tkinter.LabelFrame(text)
      • tkinter.LabelFrame(fg)
      • tkinter.LabelFrame(font)
      • Tkinter.LabelFrame.pack
      • tkinter.Listbox
      • tkinter.Listbox(background)
      • tkinter.Listbox.fg
      • tkinter.Listbox.selectbackground
      • tkinter.Listbox.highlightcolor
      • tkinter.Listbox.grid
      • tkinter.Listbox.insert
      • tkinter.Menubutton
      • tkinter.Menu
      • tkinter.Menu.add_command
      • tkinter.Message
      • tkinter.Message.pack
      • tkinter.Message.grid
      • tkinter.messagebox
      • tkinter.messagebox.showinfo
      • tkinter.N
      • tkinter.NE
      • tkinter.NW
      • tkinter.OptionMenu
      • tkinter.OptionMenu.pack
      • tkinter.OptionMenu.variable.set
      • tkinter.RIGHT
      • tkinter.RADIOBUTTON
      • tkinter.S
      • tkinter.StringVar
      • tkinter.Spinbox
      • tkinter.Spinbox(fg)
      • tkinter.Spinbox(from_)
      • tkinter.Spinbox(to)
      • tkinter.Spinbox(values)
      • tkinter.Spinbox.pack
      • tkinter.StringVar
      • tkinter.SE
      • tkinter.SW
      • tkinter.Text
      • tkinter.Text.pack
      • tkinter.Tk
      • tkinter.Tk.bind
      • tkinter.Tk.bind("<ButtonPress>")
      • tkinter.Tk.config
      • tkinter.Tk.destroy
      • tkinter.Tk.mainloop
      • tkinter.Tk.title
      • tkinter.Tk.geometry
      • tkinter.TOP
      • tkinter.W
    • webbrowser
      • webbrowser.Error()
      • webbrowser.get()
      • webbrowser.get()
      • webbrowser.open()
      • webbrowser.open_new()
      • webbrowser.open_new_tab()
    • turtle
      • turtle.back()
      • turtle.backward()
      • turtle.begin_fill()
      • turtle.begin_poly()
      • turtle.bgcolor()
      • turtle.bgpic()
      • turtle.bk()
      • turtle.bye()
      • turtle.circle()
      • turtle.clear()
      • turtle.clearscreen()
      • turtle.clearstamp()
      • turtle.clone()
      • turtle.color()
      • turtle.degrees()
      • turtle.distance()
      • turtle.done()
      • turtle.dot()
      • turtle.down()
      • turtle.end_fill()
      • turtle.end_poly()
      • turtle.exitonclick()
      • turtle.fd()
      • turtle.fillcolor()
      • turtle.fillcolor()
      • turtle.filling()
      • turtle.forward()
      • turtle.get_poly()
      • turtle.getcanvas()
      • turtle.getpen()
      • turtle.getscreen()
      • turtle.getshapes()
      • turtle.getturtle()
      • turtle.goto()
      • turtle.heading()
      • turtle.hideturtle()
      • turtle.home()
      • turtle.ht()
      • turtle.isdown()
      • turtle.isvisible()
      • turtle.left()
      • turtle.listen()
      • turtle.lt()
      • turtle.mainloop()
      • turtle.mode()
      • turtle.numinput()
      • turtle.onclick()
      • turtle.ondrag()
      • turtle.onkey()
      • turtle.onrelease()
      • turtle.onscreenclick()
      • turtle.ontimer()
      • turtle.pd()
      • turtle.pen()
      • turtle.pencolor()
      • turtle.pensize()
      • turtle.penup()
      • operator.pos()
      • turtle.position()
      • turtle.pu()
      • turtle.right()
      • turtle.rt()
      • turtle.screensize()
      • turtle.setpos()
      • turtle.setworldcoordinates()
      • turtle.setx()
      • turtle.sety()
      • turtle.shape()
      • turtle.shapetransform()
      • turtle.shearfactor()
      • turtle.showturtle()
      • turtle.speed()
      • turtle.st()
      • turtle.stamp()
      • turtle.textinput()
      • turtle.title()
      • turtle.tiltangle()
      • turtle.towards()
      • turtle.turtles()
      • turtle.turtlesize
      • turtle.up()
      • turtle.width()
      • turtle.window_width()
      • turtle.window_height()
      • turtle.write()
      • turtle.ycor()
      • turtle.xcor()

Python‎ > ‎itertools‎ > ‎

itertools.groupby()

http://www.adilwaseem.com/

Create an iterator which returns  (key, sub-iterator) grouped by each value of key(value).


iterator functions

  • itertools.accumulate()
  • itertools.chain()
  • itertools.combinations()
  • itertools.combinations_with_replacement()
  • itertools.compress()
  • itertools.count()
  • itertools.cycle()
  • itertools.dropwhile()
  • itertools.filterfalse()
  • itertools.groupby()
  • itertools.islice()
  • itertools.permutations()
  • itertools.product()
  • itertools.repeat()
  • itertools.starmap()
  • itertools.takewhile()
  • itertools.tee()
  • itertools.zip_longest()


Comments
About us | Contact us | Appointment  | BeautifulSoup4 | Download | django |Operators |  keywords | Built-in | Boolean | dict | Math | integer | decimal | pyramid | random | requests | set | frozenset | list | tuple | fractions | Fraction | string | string constants | Control Flow | itertools | time | tkinter | turtle | sitemap

The contents of this site are for training and research purposes and do not warrant the accuracy of results. We're periodically updating site to more interactive, productive, and accurate.


Python Lake | Copyright © 2018 | All rights reserved.
Contact : adil@pythonlake.com | +1-208-807-9334


Sign in|Report Abuse|Print Page|Powered By Google Sites