Have your Python skills have hit a plateau? Come learn from Python core developer and consultant Raymond Hettinger about the tips and tricks needed to move up to the next level.
This tutorial will work through a series of real-world examples, showing how an understanding of the tools built into the Python interpreter or included in the standard library can be combined to solve difficult problems clearly and Pythonically. We will also discuss when and how to reach beyond the standard library when needed to address difficult algorithmic and optimization problems. This can be taken as a stand-alone session or in conjunction with the second session; the two sessions will be complementary.
Python projects can succeed or fail because of their documentation. Thanks to Sphinx, Python now has a “documentation framework” with indexing, syntax highlighting, and integration with your code. Students will be given a small undocumented Python package, and during the exercises they will give the package a tutorial and reference manual. Plus: deployment and theming!
Python projects can succeed or fail based on their documentation. Thanks to Sphinx, Python now has a "documentation framework" that provides convenient indexing and automatic syntax highlighting, and can also integrate your documentation with your code (your documentation can be run as a test, and your class and function docstrings can become your reference documentation). Students will be given an undocumented sample Python package, and be lead through exercises that result, by the end of the tutorial, in their giving the package a full tutorial and reference manual. Deployment and theming will also be taught.
Besides a 15-minute introduction and 15 minutes for questions and discussion at the end, the tutorial will be organized in six 25-minute sessions which each involve a short lecture and then an interactive exercise that asks the students to apply what they have just learned. Here are the major topics covered by each of the six sessions:
The Sphinx approach will be linked to other successful documentation systems in our computing heritage, most notably in the practices it shares in common with the Unix Documenter's Workbench (DWB) of the 1970s.
by Ian Ozsvald
At EuroPython 2011 I ran a very hands-on tutorial for High Performance Python techniques. This updated tutorial will cover profiling, PyPy, Cython, numpy, NumExpr, ShedSkin, multiprocessing, ParallelPython and pyCUDA. Here's a 55 page PDF write-up of the EuroPython material: http://ianozsvald.com/2011/07/25...
At EuroPython 2011 I ran a very hands-on tutorial for High Performance Python techniques. This updated tutorial will cover:
I plan to expand the original material and to maybe also cover other tools like execnet and PyPy-numpy.
by Katie Cunningham and Richard Jones
This tutorial will walk the attendees from some introductory game development theory (what makes a good game) and through development of a simple game (how to make a good game) with time left over for some experimentation and exploration of different types of games.
The tutorial will start with Katie Cunningham giving an introduction to video games, covering the basic components of a game, and some general game genres. Some basic tropes in modern games will be explored, as well as pitfalls to avoid in making a game for a today’s audience. Genres will be paired with inexpensive/free examples that can be explored by the tutorial attendees later.
The baton will then pass to Richard Jones who will walk through the practicalities of building a simple video game from scratch, starting with presenting one approach to structuring the game code to keep it sane. He will talk about what libraries are available and then focus on the facilities present in the library used in the tutorial.
We will then walk through the development of a simple game during which the attendees will code the game. Once the game is developed we will talk about potential further development that possibilities and use the remaining tutorial time to encourage and assist attendees in their efforts to do so.
The game developed will cover the key game-writing skills of controlling what appears on the screen (including animation), loading resources, handling user input and simulating the environment within the game.
Participants should be familiar with Python, and must have pygame installed. We will not have time to deal with installation and compatibility issues so participants must check their laptops can run pygame applications.
From how the operating system handles your requests through design principles on how to use concurrency and parallelism to optimize your program's performance and scalability. We will cover processes, threads, generators, coroutines, non-blocking IO, and the gevent library.
How processes, threads, coroutines, and non-blocking IO work from the operating system through code implementation and design principles to optimize Python programs. The difference between parallelism and concurrency and when to use each.
The premise is that to make an informed decision you need to know what is happening under the hood. Once you understand the low level functionality, you can make the correct decision in the design phase.
The emphasis is on practical application to solve real world problems.
Outline
by Mike Müller
When it comes to plotting with Python many people think about matplotlib. It is widely used and provides a simple interface for creating a wide variety of plots from very simple diagrams to sophisticated animations. This tutorial is a hands-on introduction that teaches the basics of matplotlib. Students will learn how to create publication-ready plots with just a few lines of Python.
Target Audience
This tutorial is for Python users who would like to create nice 2d plots with Python.
Audience Level
Students should have a working knowledge of Python. NumPy knowledge is helpful but not required.
Prerequisites
Please bring your laptop with the operating system of your choice (Linux, Mac OS X, Windows). In addition to Python 2.6 or 2.7, we need: - a current versions of matplotlib (http://matplotlib.sourceforge.net) - IPython (http://ipython.org) and - NumPy (http://numpy.scipy.org).
Method
This is a hands-on course. Students are strongly encouraged to work along with the trainer at the interactive prompt. There will be exercises the students need to do on their own. Experience shows that this active involvement is essential for an effective learning.
Content
The library matplotlib provides many different types of diagrams from within Python with only few lines of code. Examples are used to exercise the use of this library. The tutorial provides an overview how to create plots with matplotlib. IPython in combination with pylab from matplotlib provides an interactive environment for fast testing of ideas. We will be using this for most of the tutorial.
With a simple plot we learn how to add axis labels, titles and a legend. The GUI offers zooming, panning, changing of plot sizes and other interactive ways to modify the plot. We will use Python to change properties of existing plots such as line colors, marker symbols, or line styles. There are several ways how to place text on plots. You will learn about the different coordinate systems relative to the plot, the canvas or the figure. Another topic are ticks, where to put them and how to format them to achieve publication-quality plots. The concepts of figures, subplots, and axes and how they relate to each other will be explained with examples.
matplotlib offers many different types of plots. The tutorial introduces several of them with an example. A more advanced topic will be creating your own plot types. We will build a stacked plot type. Finally, we will create a small animation to explore the possibilities to visualize changes.
Outline
by Stuart Williams
This tutorial is for software developers who've been using Python with success for a while but are looking for a deeper understanding of the language. It demystifies a number of language features that are often misunderstood.
In many ways Python is very similar to other programming languages. However, in a few sometimes subtle ways it is quite different, and many software developers new to Python, after their initial successes, hit a plateau and can't figure out how to get past it. Others don't hit or perceive a plateau, but still find some of Python's features a little mysterious. This tutorial will help deconstruct your incorrect assumptions about Python and pull away the mists of confusion.
If in your use of Python you sometimes feel like an outsider, like you're missing the inside jokes, or like you have most of the puzzle pieces but they don't quite fit together yet, this may be a good tutorial for you.
After completing this tutorial you'll have a deeper understanding of many Python features. Here are some of the topics we'll cover:
Attendee Requirements
Bring a laptop computer with a recent version of Python 2.7 or Python 3 installed.
Prerequisites
Intermediate ability in Python and little or no fear of iterators, generators, classes, methods, and how to call a function that's stored in a data structure.
Social Network data permeates our world -- yet we often don't know what to do with it. In this tutorial, I will introduce both theory and practice of Social Network Analysis -- gathering, analyzing and visualizing data using Python and other open-source tools. I will walk the attendees through an entire project, from gathering and cleaning data to presenting results.
SNA techniques are derived from sociological and social-psychological theories and take into account the whole network (or, in case of very large networks such as Twitter -- a large segment of the network). Thus, we may arrive at results that may seem counter-intuitive -- e.g. that Justin Bieber (7.5 mil. followers) and Lady Gaga (7.2 mil. followers) have relatively little actual influence despite their celebrity status -- while a middle-of-the-road blogger with 30K followers is able to generate tweets that "go viral" and result in millions of impressions.
In this tutorial, we will conduct social network analysis of a real dataset, from gathering and cleaning data to analysis and visualization of results. We will use Python and a set of open-source libraries, including NetworkX, NumPy and Matplotlib.
Outline:
Have your Python skills have hit a plateau? Come learn from Python core developer and consultant Raymond Hettinger about the tips and tricks needed to move up to the next level.
This tutorial will work through a series of real-world examples, showing how an understanding of the tools built into the Python interpreter or included in the standard library can be combined to solve difficult problems clearly and Pythonically. We will also discuss when and how to reach beyond the standard library when needed to address difficult algorithmic and optimization problems. This can be taken as a stand-alone session or in conjunction with the second session; the two sessions will be complementary.
by Luis Artola
Presents techniques and patterns for creating custom PyQt widgets easily. Focus is the separation of layout and logic to produce code that is easy to read and understand, and also inexpensive to maintain and evolve. Encourages and demonstrates the use of layout design applications, code generators and composition over inheritance. Based on PyQt4 but easily applicable to PySide as well.
Many developers favor the creation of graphical user interfaces by hand-coding the layout of the interface elements. Most often than not, the resulting code is a highly cohesive mix of user interface and business logic that is not easy to maintain. Likewise, the development of custom widgets is often approached by subclassing top-level classes and overriding paint and event-handling methods. While this is the only alterantive for certain types of custom widgets, there is a big percentage that could be more easily created by composition of smaller widgets assembled together to work in as a unit.
This tutorial aims to share the following with the audience:
All material is based on Python and PyQt4. Audience is expected to have working knowledge of PyQt. Or, at least proficiency developing application in Qt and C++.
This tutorial is based on PyQt4 but concepts and techniques can be easily transferrable to PySide. Attendees require access to a computer with the following:
An easy way to check whether the Python plugin is available or not is to select from QtDesigner's main menu: Help > About Plugins > Loaded Plugins, should show libpythonplugin.so. This is normally installed automatically by the Qt installer.
The world of infrastructure as code is becoming far more pervasive and many Python developers are trying to find a way to get started. This class will get you up and running with Chef and Fabric to manage your systems be they in the cloud or under your desk.
Students must have a laptop with the Chef gem and git installed. Install instructions will sent out before the class.
Agenda
In this tutorial, I will cover how to write very fast Python code for data analysis. I will briefly introduce NumPy and illustrate how fast code for Python is written in SciPy using tools like Fwrap / F2py and Cython. I will also describe interesting new approaches to creating fast code that is leading changes to NumPy on a fundamental level.
In this tutorial, I will cover how to write very fast Python code for data analysis including making use of NumPy and using GPUs. I will largely focus on writing extensions to Python using hand-wrapping and Cython but will touch also on using tools like weave, Instant, ShedSkin and compare them to PyPy. I will also spend the last part of the tutorial on using GPUs with Python and discuss the performance trade-offs of the technology. This will be a high-level overview of the space with deep dives in Cython and GPUs
Outline:
The goal of this tutorial is to give the attendee a first experience of machine learning tools applied to practical software engineering tasks such as language detection of tweets, topic classification of web pages, sentiment analysis of customer products reviews and facial recognition in pictures from the web or from your own webcam.
The demand for software engineers with Data Analytics and Machine Learning skills is rapidly growing and Python / Numpy is one of the best environments for quickly prototyping scalable data-centric applications or interactively exploring your data especially thanks to tools such as IPython and Matplotlib.
scikit-learn is a very active open source project that implements a variety of state-of-the art machine learning algorithms. The goal of this project and tutorial is to take the algorithms out of the academic papers and make them work on a selection of real world tasks to unleash the value of your data.
We will focus on providing hints to perform the right data preprocessing steps and on how to select algorithms and parameters suitable for the task at hand. We will also introduce tools and methodologies to measure the performance of the trained models as objectively as possible.
Learn the basics of natural language processing with NLTK, the Natural Language ToolKit. First we'll cover tokenization, stemming and wordnet. Next we'll get into part-of-speech tagging, chunking & named entity recognition. Then we'll close with text classification and sentiment analysis. You'll walk out with new super-powers and an appreciation of the difficulties of analyzing human language.
This tutorial will be a hands on approach to learning natural language processing using NLTK, the Natural Language ToolKit. We will cover everything from tokenizing sentences to phrase extraction, from splitting words to training your own text classifiers for sentiment analysis. Please come prepared with NLTK already installed so we can dive into the code & data immediately.
Hour 1: Tokenization, Stemming & Corpora
Tokenization & familiarity with corpus readers and models are required knowledge before you can get into the more interesting aspects of NLTK. This first hour will include:
Hour 2: Part-of-Speech Tagging & Chunking/NER
Using tokenization and a working knowledge of corpus readers & pickled models, we'll dive into part-of-speech tagging and chunking/NER, including:
Hour 3: Text Classification & Sentiment Analysis
After using classifiers for training part-of-speech taggers and chunkers, this final hour will explain text classification in greater detail with:
Wrapping Up
Now that you know how to use NLTK to process some of the included English corpora, we'll wrap up by covering:
by Pedro Kroger
Are you interested in learning more about Music but have found most material to be kind of patronizing or to present things magically instead of logically? The good news is that much of music can be understood with programming and math, two things you're already good at! In this hands-on workshop you'll learn some elements of music from a (Python) programmer's perspective.
There are (many) music operations that can be expressed directly in Math and code. Just to give you a taste, tranposing a set of notes to an interval i is as simple as [(n + i) % 12 for n in notes].
In this tutorial we'll explore the primitives of Music (notes, intervals, dynamics, articulations, and duration), take a look inside them, the means of combining those primitives (motives, chords, operations such as transposition, retrograde, inversion), and the means of abstraction (phrases, harmonic functions and progressions, and form) using Python and some basic Math. At the end of this tutorial you should have a demysthified understanding of many elements of Music and be able to use Python to create short compositions.
You can find a list of required libraries and programs, with installation instructions at https://github.com/kroger/learni....
by Zain Memon
This tutorial teaches students how to create beautiful, interactive maps for the web. When asked to display geodata, most developers decide to put some big red markers on an embeddable Google Map and call it a day. If you're interested in creating maps that are more beautiful, more interactive, and more usable, this tutorial is for you.
Build a light-weight version of Trulia's crime maps from scratch by the end of the tutorial, with a heatmap, source data points on the map, and a custom-styled base layer.
Prerequisite Knowledge
A solid understanding of Python, and very basic understanding of map concepts (like knowing what latitudes and longitudes are). A cursory run-through of the GeoDjango Introduction Tutorial would also be helpful.
Topics Covered