From 5849e3e5056dc49d1a8e3cc841226e6795041bd8 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 12 Jul 2010 16:36:56 -0400 Subject: [PATCH] documentation update --- README.mkd | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/README.mkd b/README.mkd index e62c67e..326d1c2 100644 --- a/README.mkd +++ b/README.mkd @@ -31,29 +31,36 @@ Populate fresh data files: ('George', 'Washington', 2.6), ('Henry', 'Ford', 2.3) ] - data = tabbed.Data(*data, headers=headers) - # Save data, but no - data.save() - # >>> Error: No filename has been established - # Establish file location and save data.save('test.xls') + +Intelligently add new rows: + data.addRow('Bob', 'Dylan') # >>> Warning: Existing column count is 3 print data.headers # >>> ('first_name', 'last_name', 'gpa') + +Slice rows: + print data[0:1] # >>> [('John', 'Adams', 4.0), ('George', 'Washington', 2.6)] + +Slice columns by header: + print data['first_name'] # >>> ['John', 'George', 'Henry'] + +Manipulate rows by index: + data.delRow(0) print data[0:1] # >>> [('George', 'Washington', 2.6), ('Henry', 'Ford', 2.3)] @@ -61,5 +68,8 @@ Populate fresh data files: # Update saved file data.save() + +Export to various formats: + # Save copy as CSV data.export('backup.csv') \ No newline at end of file