summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDaniel Santos <dfsantosbu@unal.edu.co>2019-10-29 22:08:31 +0100
committerDaniel Santos <dfsantosbu@unal.edu.co>2019-10-29 22:08:31 +0100
commitd94420d96805f088df81f0975306b09ae83bcb60 (patch)
tree60d643212d4fea9af17b83e22eff5e9f3ceb97c0 /docs
parent51a720b21c261e6f6b2f0f882ee835d9d97ab7ef (diff)
downloadtablib-d94420d96805f088df81f0975306b09ae83bcb60.tar.gz
Elucidate the use of filters (and, or).
Diffstat (limited to 'docs')
-rw-r--r--docs/tutorial.rst18
1 files changed, 14 insertions, 4 deletions
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index 2be7210..aa2d019 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -293,16 +293,26 @@ Let's tag some students. ::
students.headers = ['first', 'last']
students.rpush(['Kenneth', 'Reitz'], tags=['male', 'technical'])
+ students.rpush(['Daniel', 'Dupont'], tags=['male', 'creative' ])
students.rpush(['Bessie', 'Monke'], tags=['female', 'creative'])
-Now that we have extra meta-data on our rows, we can 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 Female students. ::
+ >>> students.filter(['female']).yaml
+ - {first: Bessie, Last: Monke}
- >>> students.filter(['male']).yaml
- - {first: Kenneth, Last: Reitz}
+By default, when you pass a list of tags you get filter type or. ::
-It's that simple. The original :class:`Dataset` is untouched.
+ >>> students.filter(['female', 'creative']).yaml
+ - {first: Daniel, Last: Dupont}
+ - {first: Bessie, Last: Monke}
+
+Using chaining you can get a filter type and. ::
+ >>> students.filter(['female']).filter(['creative']).yaml
+ - {first: Bessie, Last: Monke}
+
+It's that simple. The original :class:`Dataset` is untouched.
Open an Excel Workbook and read first sheet
-------------------------------------------