summaryrefslogtreecommitdiff
path: root/docs/index.rst
diff options
context:
space:
mode:
authorJean Jordaan <jean.jordaan@gmail.com>2019-03-03 13:29:21 +0700
committerGitHub <noreply@github.com>2019-03-03 13:29:21 +0700
commitaddaa090efb4d4beacb2bd2cc6dbdb7e158fa2a9 (patch)
treede3b532ed49a0d1e8a2e333b549b129d534bff91 /docs/index.rst
parentcd67a63b434c33430d8fd32d6d15027b42811d9d (diff)
parent79dc77de49b8375d616a6cabb4503feb990bb51d (diff)
downloadtablib-addaa090efb4d4beacb2bd2cc6dbdb7e158fa2a9.tar.gz
Merge branch 'master' into master
Diffstat (limited to 'docs/index.rst')
-rw-r--r--docs/index.rst15
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/index.rst b/docs/index.rst
index 18d100e..570e1e5 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -30,18 +30,25 @@ and seamless format import & export.
::
>>> data = tablib.Dataset(headers=['First Name', 'Last Name', 'Age'])
- >>> map(data.append, [('Kenneth', 'Reitz', 22), ('Bessie', 'Monke', 21)])
+ >>> for i in [('Kenneth', 'Reitz', 22), ('Bessie', 'Monke', 21)]:
+ ... data.append(i)
- >>> print data.json
+
+ >>> print(data.export('json'))
[{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 21}]
- >>> print data.yaml
+ >>> print(data.export('yaml'))
- {Age: 22, First Name: Kenneth, Last Name: Reitz}
- {Age: 21, First Name: Bessie, Last Name: Monke}
- >>> data.xlsx
+ >>> data.export('xlsx')
<redacted binary data>
+ >>> data.export('df')
+ First Name Last Name Age
+ 0 Kenneth Reitz 22
+ 1 Bessie Monke 21
+
Testimonials
------------