Get Lanyrd on your mobile (iPhone, Android and more) - check it out here

Python's other collection types and algorithms

A session at EuroPython 2011

It's impossible to use Python without learning about lists, dictionaries and tuples, and most people have at least heard about sets. These four collection types are so important and useful that Python has special syntax for creating them.

Fewer people know about Python's other built-in collection data types and algorithms. A deque supports fast appends and pops from both ends and is great for breath-first searches, the heapq module helps you construct a priority queue on top of lists, and the bisect module is handy for quick binary searches of an already sorted list.

The defaultdict uses the dict __missing__ hook as a better solution to setdefault, OrderedDict is a dictionary that preserves insertion order, and Counter is a dictionary specialized for counting hashable objects. A namedtuple is handy if you want to support both index and attribute lookups for the same item, and a frozenset is a hashable form of a set which can be used as keys in a dictionary or set.

My talk will go over these 8 different classes and modules. I'll give concrete examples of how to use them and why they are useful. The target audience is intermediate programmers who are familiar with the Python's standard data types and with data types in general, but who don't know all of the functionality available in modern Python.

About the speaker

This person is speaking at this event.
Andrew Dalke

Owner, Dalke Scientific Software, LLC bio from LinkedIn

Coverage of this session

Sign in to add slides, notes or videos to this session

EuroPython 2011

Italy Italy, Florence

20th26th June 2011

Tell your friends!

When

Time 3:30pm4:30pm CET

Date Tue 21st June 2011

Short URL

lanyrd.com/sftzr

View the schedule

Topics

See something wrong?

Report an issue with this session