{ "metadata": {}, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Addressing Array Columns by Name\n", "================================\n", "\n", "There are two very closely related ways to access array columns by name:\n", "recarrays and structured arrays. Structured arrays are just ndarrays\n", "with a complicated data type:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "#!python numbers=disable\n", "In [1]: from numpy import *\n", "In [2]: ones(3, dtype=dtype([('foo', int), ('bar', float)]))\n", "Out[2]:\n", "array([(1, 1.0), (1, 1.0), (1, 1.0)],\n", " dtype=[('foo', '