Changeset 7109


Ignore:
Timestamp:
May 28, 2009, 9:24:00 AM (11 years ago)
Author:
rwilson
Message:

Documentation changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/utilities/csv_tools.py

    r7101 r7109  
    1313    '''Select key and value columns from 'N' CSV files, write one CSV file.
    1414
    15     file_title_list: a list of (filename, new_value_column_title) values, one
    16                      for each file
     15    file_title_list: a list of (filename, new_data_column_title) values, one
     16                     for each input file
    1717    output_file:     the output CSV file path
    1818    key_col:         column header string of key column
    19     data_col:        column header string of value column
     19    data_col:        column header string of data column
    2020
    2121    The output file will look like:
    22         <key_col>,   <new_value_column_title1>, <new_value_column_title2>, ...
    23         <key_value>, <data1>,                   <data2>,                   ...
    24         <key_value>, <data1>,                   <data2>,                   ...
    25         <key_value>, <data1>,                   <data2>,                   ...
    26         <key_value>, <data1>,                   <data2>,                   ...
     22        <key_col>,   <new_data_column_title1>, <new_data_column_title2>, ...
     23        <key_value>, <data1>,                  <data2>,                  ...
     24        <key_value>, <data1>,                  <data2>,                  ...
     25        <key_value>, <data1>,                  <data2>,                  ...
     26        <key_value>, <data1>,                  <data2>,                  ...
    2727
    2828    There is an assumption that the <key_value> values are the same across
     
    7676        file_data.append((filename, title, data))
    7777
    78     # now, file_data -> [(filename, title, [(k,v), (k,v), ...]]
     78    # now, file_data -> [(filename, title, [(k,v), (k,v), ...], ...]
    7979    # sanity check, check num rows same in all files
    8080    num_rows = None
     
    103103
    104104    # write column rows to output file
    105     # at this point, file_data=[(<filename>, <col_title>, [(k,v), ...]), ...]
    106105    header = [key_col]
    107106    for (fn, col, d) in file_data:
Note: See TracChangeset for help on using the changeset viewer.