InputTable#

settings activitysim.core.configuration.InputTable#

The features that define an input table to be read by ActivitySim.

Fields:
  • drop_columns (list[str])

  • dtypes (dict[str, str])

  • filename (pathlib.Path)

  • h5_tablename (str)

  • index_col (Optional[str])

  • keep_columns (list[str])

  • recode_columns (dict[str, str])

  • rename_columns (dict[str, str])

  • tablename (str)

field drop_columns: list[str] = None#

Columns to drop once read in to memory.

Save only the columns needed for modeling or analysis to save on memory and file I/O. If not given, all columns in the input file will be read and retained.

field dtypes: dict[str, str] = None#

dtypes for loaded columns

field filename: Path = None#

Name of the CSV or HDF5 file to read.

If not provided, defaults to input_store

field h5_tablename: str = None#

table name if reading from HDF5 and different from tablename

field index_col: Optional[str] = 'NOTSET'#

table column to use for the index

field keep_columns: list[str] = None#

Columns to keep once read in to memory.

Save only the columns needed for modeling or analysis to save on memory and file I/O. If not given, all columns in the input file will be read and retained.

field recode_columns: dict[str, str] = None#

Dictionary of column recoding instructions.

Certain columns of data, notably TAZ and MAZ id’s, are more efficiently stored as the index (offset) position of each value within a fixed array of values, instead of as the value itself. To recode a column into this offset format, give the value “zero-based” for that column name. This will replace the named column with a RangeIndex, starting from zero, and will create a lookup column of the original values, which is not used by ActivitySim other than to recode other related variables, or to reconstitute the original labels for a final output table. This zero-based recoding is typically done for the zone_id field in the land_use table, but might also be done elsewhere.

Alternatively, for columns that contain references to recoded data, give the recode instruction as “tablename.fieldname” (often, “land_use.zone_id”). This will trigger a remapping of each value according to the stored lookup table for the original values, transforming the values in other columns to be consistent with the recoded zero-based values. For example, if the zone_id field in the land_use table has been recoded to be zero-based, then the home_zone_id in the households table needs to be recoded to match.

Note that recoding is done after renaming, so the key values in this mapping should correspond to the internally used names and not the original column names that appear in the input file (if they have been renamed).

field rename_columns: dict[str, str] = None#

Dictionary of column name mappings.

This allows for renaming data columns from the original names found in the header of the input file itself, into the names used internally by ActivitySim, in configuration and specification files.

field tablename: str [Required]#

Name of the injected table