background preloader

Python

Facebook Twitter

Python Mode for Processing. PyToolz API Documentation — Toolz 0.6.0 documentation. Toolz provides a set of utility functions for iterators, functions, and dictionaries.

PyToolz API Documentation — Toolz 0.6.0 documentation

These functions interoperate well and form the building blocks of common data analytic operations. They extend the standard libraries itertools and functools and borrow heavily from the standard libraries of contemporary functional languages. Toolz provides a suite of functions which have the following functional virtues: Composable: They interoperate due to their use of core data structures.Pure: They don’t change their inputs or rely on external state.Lazy: They don’t run until absolutely necessary, allowing them to support large streaming data sets. Toolz functions are pragmatic. Low Tech: They’re just functions, no syntax or magic tricks to learnTuned: They’re profiled and optimizedSerializable: They support common solutions for parallel computing This gives developers the power to write powerful programs to solve complex problems with relatively simple code.

Vispy: OpenGL-based interactive visualization in Python — vispy. Python Data Analysis Library — pandas: Python Data Analysis Library. Intro to pandas data structures. A while back I claimed I was going to write a couple of posts on translating pandas to SQL.

Intro to pandas data structures

I never followed up. However, the other week a couple of coworkers expressed their interest in learning a bit more about it - this seemed like a good reason to revisit the topic. What follows is a fairly thorough introduction to the library. I chose to break it into three parts as I felt it was too long and daunting as one. Part 1: Intro to pandas data structures, covers the basics of the library's two main data structures - Series and DataFrames.Part 2: Working with DataFrames, dives a bit deeper into the functionality of DataFrames. If you'd like to follow along, you can find the necessary CSV files here and the MovieLens dataset here. My goal for this tutorial is to teach the basics of pandas by comparing and contrasting its syntax with SQL. Python4oceanographers. Mechanical Scribe - Binify + D3 = Gorgeous honeycomb maps - Mechanical Scribe. Most Americans prefer to huddle together around urban areas, which raises all sorts of problems for map-based visualizations.

Mechanical Scribe - Binify + D3 = Gorgeous honeycomb maps - Mechanical Scribe

Coloring regions according to a data value, known as a choropleth map, leaves the map maker beholden to arbitrary political boundaries and, at the county level, pixel-wide polygons in parts of the Northeast. Many publications prefer to place dots proportional in area to the data values over the center of each county, which inevitably produces overlapping circles in these same congested regions. Here's a particularly atrocious example of that strategy I once made at Slate: Two weeks ago, Kevin Schaul released an exciting new command-line tool called binify that offers a brilliant alternative. Schaul's tool takes a series of points and clusters them (or "bins" them) into hexagonal tiles. Binify operates on .shp files, which can be a bit difficult to work with for those of us who aren't GIS pros.

We're going to use one small Python script to create our .shp file. Welcome — pysal v1.7.0 Reference Guide. PySAL is a cross-platform library of spatial analysis functions written in Python.

Welcome — pysal v1.7.0 Reference Guide

It is intended to support the development of high level applications for spatial analysis. PySAL is Open Source and licensed under the BSD License. Downloads Source downloads are hosted on the Python Package Index. Graphical installers for recent releases are hosted on the GeoDa Center website. Legacy builds (<=1.5) are still available on the old source code repository at Google Code, here. Getting Involved. GeospatialPython.com.