mirror of
https://github.com/kennethreitz/tablib.git
synced 2026-06-05 06:56:13 +00:00
+8
-3
@@ -29,18 +29,23 @@ Tablib is an :ref:`MIT Licensed <mit>` format-agnostic tabular dataset library,
|
|||||||
>>> data = tablib.Dataset(headers=['First Name', 'Last Name', 'Age'])
|
>>> data = tablib.Dataset(headers=['First Name', 'Last Name', 'Age'])
|
||||||
>>> for i in [('Kenneth', 'Reitz', 22), ('Bessie', 'Monke', 21)]:
|
>>> for i in [('Kenneth', 'Reitz', 22), ('Bessie', 'Monke', 21)]:
|
||||||
... data.append(i)
|
... data.append(i)
|
||||||
|
|
||||||
|
|
||||||
>>> print data.json
|
|
||||||
|
>>> print(data.json)
|
||||||
[{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 21}]
|
[{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 21}]
|
||||||
|
|
||||||
>>> print data.yaml
|
>>> print(data.yaml)
|
||||||
- {Age: 22, First Name: Kenneth, Last Name: Reitz}
|
- {Age: 22, First Name: Kenneth, Last Name: Reitz}
|
||||||
- {Age: 21, First Name: Bessie, Last Name: Monke}
|
- {Age: 21, First Name: Bessie, Last Name: Monke}
|
||||||
|
|
||||||
>>> data.xlsx
|
>>> data.xlsx
|
||||||
<censored binary data>
|
<censored binary data>
|
||||||
|
|
||||||
|
>>> data.df
|
||||||
|
First Name Last Name Age
|
||||||
|
0 Kenneth Reitz 22
|
||||||
|
1 Bessie Monke 21
|
||||||
|
|
||||||
|
|
||||||
Testimonials
|
Testimonials
|
||||||
------------
|
------------
|
||||||
|
|||||||
Reference in New Issue
Block a user