Update - 1/18/2007

Update - 1/14/2007

Dbase

The dbase.py class, can be used to read/write/summarize/plot time-series data.

To summarize the functionality:

  1. data and variable names stored in a dictionary - accessible using variable names
  2. load/save from/to csv/pickle format, including date information (shelve format to be added)
  3. plotting and descriptive statistics, with dates if provided
  4. adding/deleting variables, including trends/(seasonal)dummies
  5. selecting observations based on dates or other variable values (e.g., > 1/1/2003)

  6. copying instance data

Attached also the dbase_pydoc.txt information for the class.

Example Usage

To see the class in action download the file and run it (python dbase.py). This will create an example data file (./dbase_test_files/data.csv) that will be processed by the class.

To import the module:

   1 import dbase

After running the class you can load the example data using

   1 data = dbase.dbase("./dbase_test_files/data.csv", date = 0)

In the above command '0' is the index of the column containing dates.

You can plot series 'b' and 'c' in the file using

   1 data.dataplot('b','c')

You get descriptive statistics for series 'a','b', and 'c' by using

   1 data.info('a','b','c')

Since there is date information in data.csv this information will be added automatically when calling dataplot() or info().

There is an extensive set of examples at the bottom of the code file that demonstrates the functionality of the class.


CategoryCookbook

Cookbook/dbase (last edited 2007-01-19 05:55:14 by VincentNijs)