summaryrefslogtreecommitdiff
path: root/docs/tutorial.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/tutorial.rst')
-rw-r--r--docs/tutorial.rst13
1 files changed, 10 insertions, 3 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 561b24c..bd2dbc0 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -68,7 +68,7 @@ Adding Headers
--------------
-It's time enhance our :class:`Dataset` by giving our columns some titles. To do so, set :class:`Dataset.headers`. ::
+It's time to enhance our :class:`Dataset` by giving our columns some titles. To do so, set :class:`Dataset.headers`. ::
data.headers = ['First Name', 'Last Name']
@@ -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']
@@ -244,7 +251,7 @@ Filtering Datasets with Tags
When constructing a :class:`Dataset` object, you can add tags to rows by specifying the ``tags`` parameter.
-This allows you to filter your :class:`Dataset` later. This can be useful so separate rows of data based on
+This allows you to filter your :class:`Dataset` later. This can be useful to separate rows of data based on
arbitrary criteria (*e.g.* origin) that you don't want to include in your :class:`Dataset`.
Let's tag some students. ::
@@ -256,7 +263,7 @@ Let's tag some students. ::
students.rpush(['Kenneth', 'Reitz'], tags=['male', 'technical'])
students.rpush(['Bessie', 'Monke'], tags=['female', 'creative'])
-Now that we have extra meta-data on our rows, we can use easily filter our :class:`Dataset`. Let's just see Male students. ::
+Now that we have extra meta-data on our rows, we can easily filter our :class:`Dataset`. Let's just see Male students. ::
>>> students.filter(['male']).yaml