summaryrefslogtreecommitdiff
path: root/docs/tutorial.rst
diff options
context:
space:
mode:
authorMark Walling <mark@markwalling.org>2011-07-11 17:13:47 -0400
committerMark Walling <mark@markwalling.org>2011-07-11 17:26:21 -0400
commite74a8f41cc0bdfe1cb9aae90b9240fd15208e9cb (patch)
tree01cc0408ffea156442f723de66ead76ba9dba5e5 /docs/tutorial.rst
parentcd5aa4fc06d9af90b076c02a9f596bb84db1d09f (diff)
downloadtablib-e74a8f41cc0bdfe1cb9aae90b9240fd15208e9cb.tar.gz
Created get_col method with tests and tutorial.rst update
Useful when you have multiple columns with the same header
Diffstat (limited to 'docs/tutorial.rst')
-rw-r--r--docs/tutorial.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 561b24c..117196d 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -146,6 +146,13 @@ To do so, we access the :class:`Dataset` as if it were a standard Python diction
>>> data['First Name']
['Kenneth', 'Bessie']
+You can also access the column using its index. ::
+
+ >>> d.headers
+ ['Last Name', 'First Name', 'Age']
+ >>> d.get_col(1)
+ ['Kenneth', 'Bessie']
+
Let's find the average age. ::
>>> ages = data['Age']