<s> import os <EOL> import orca <EOL> import pandas as pd <EOL> def size_term ( land_use , destination_choice_coeffs ) : <EOL> """<STR_LIT>""" <EOL> coeffs = destination_choice_coeffs <EOL> missing = coeffs [ ~ coeffs . index . isin ( land_use . columns ) ] <EOL> if len ( missing ) > <NUM_LIT:0> : <EOL> print "<STR_LIT>" , missing . index <EOL> return land_use [ coeffs . index ] . dot ( coeffs ) <EOL> @ orca . table ( ) <EOL> def size_terms ( configs_dir ) : <EOL> f = os . path . join ( configs_dir , '<STR_LIT>' , <EOL> '<STR_LIT>' ) <EOL> return pd . read_csv ( f , index_col = '<STR_LIT>' ) <EOL> @ orca . table ( ) <EOL> def destination_size_terms ( land_use , size_terms ) : <EOL> land_use = land_use . to_frame ( ) <EOL> size_terms = size_terms . to_frame ( ) <EOL> df = pd . DataFrame ( { key : size_term ( land_use , row ) <EOL> for key , row in size_terms . iterrows ( ) } , <EOL> index = land_use . index ) <EOL> df . index . name = "<STR_LIT>" <EOL> return df </s>
