Real Ultimate Programming

The Home for People Who Like to Flip Out and Write Code

Notes From PyATL 2013-06-13


  • distribute and setuptools have finally merged (see also: the announcement).
  • The Atlanta chapter of PyLadies will be giving the presentations on their 1-year anniversary (or the closest night to their 1-year anniversary).
  • J.R. is starting a Smyrna tech group.

One-liner fizz-buzz (Doug Hellmann)

  • I’m excited; I don’t think I’ve ever seen Doug golfing code before.
  • He starts by discussing somebody else’s golfed version; I has a sad.
  • But here’s his solution. I dig it.

PANDAS: Python Data Analysis Library (Andy Henshaw)

  • Interesting; why do a custom thing to drive PowerPoint from iPython. Isn’t that a pretty close parallel to iPython Notebook?
  • First primitive: a Series
    • It’s an array-like that contains data and labels (or indices).
    • The data must be of the same type.
    • Asking for multiple labels gives you a view into the series; providing a single label gives you the value for that label.
    • Labels don’t have to be unique; if you have multiple values for a single label, then requesting that label’s value gives you a view, much like asking for multiple labels’ values.
    • Can accommodate incomplete data; labels without values represent the value as NaN.
    • NaN is used even for a Series of strings.
    • Data is automatically aligned (that’s pretty sweet).
  • Second primitive: a Dataframe
    • It’s tabular data, a la a spreadsheet.
    • Easy to create one from a dict of equal-length lists.
    • Or you could pass a dict of dicts.
    • You can add new columns to existing Dataframes using either direct assignment or calculation.
    • You can re-index.
  • Bring on the stats!
    • It’s smart about figuring out how to apply descriptive stats like sum to columns/rows.
  • All sorts of useful import functionality for structured data, e.g., JSON, CSV, et al.
  • OK, once he started talking about crosstabs, I was in the territory where I have a hard time keeping up during a talk.
  • Plotting w/ matplotlib is just cool. I need to get better at this sort of stuff.
  • TimeSeries sounds totally awesome.

[None]: True or False? (Cliff Kachinske)

  • I wonder how you’d address this in a general way.
  • The consensus in the room seems to be that any and all are the best way to go.

Creating Python Bindings for C++ using boost::python (Aleksey Vitebskiy)

  • A dig at JNI? I like this guy already.
  • C++ wrappers for the major Python objects
  • Declarative-style API
  • Man, C++ is so alien to me, now. It took me a while to really read a few of those lines.
  • It allows extensive interop: you can extend Python classes, Python classes can extend C++ classes… pretty hardcore.
  • It does full-on MRO stuff, so it fully supports multiple inheritance (color me impressed); no metaclasses, though :-(
  • Haha! You don’t see duck-typing in conjunction with C++ all that often.
  • This slide of pros and cons vs. SWIG is gold if you need this functionality.