Skip to content

Commit

Permalink
Update read_model_spec docstring
Browse files Browse the repository at this point in the history
[ci-skip]
  • Loading branch information
jiffyclub committed Feb 23, 2015
1 parent ee5df01 commit 0fdbcaf
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion activitysim/activitysim.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,30 @@ def read_model_spec(fname,
description_name="Description",
expression_name="Expression"):
"""
Read in the excel file and reformat for machines
Read a CSV model specification into a Pandas Series.
The CSV is expected to have columns for component descriptions
and expressions, plus one or more alternatives.
The CSV is required to have a header with column names. For example:
Description,Expression,alt0,alt1,alt2
Parameters
----------
fname : str
Name of a CSV spec file.
description_name : str, optional
Name of the column in `fname` that contains the component description.
expression_name : str, optional
Name of the column in `fname` that contains the component expression.
Returns
-------
spec : pandas.Series
The description is dropped from the returned data and the table
is stacked so that it has a multi-index of (expression, alt-name)
and value are the alternative specific utilities.
"""
cfg = pd.read_csv(fname)
# don't need description and set the expression to the index
Expand Down

0 comments on commit 0fdbcaf

Please sign in to comment.