dataframes#

swmmio.utils.dataframes.create_dataframe_multi_index(inp_path, section='CURVES')[source]#
swmmio.utils.dataframes.dataframe_from_bi(bi_path, section='[CONDUITS]')[source]#

given a path to a build instructions file, create a dataframe of data in a given section

swmmio.utils.dataframes.dataframe_from_inp(inp_path, section, additional_cols=None, quote_replace=' ', **kwargs)[source]#

create a dataframe from a section of an INP file :param inp_path: :param section: :param additional_cols: :param skip_headers: :param quote_replace: :return:

swmmio.utils.dataframes.dataframe_from_rpt(rpt_path, section, element_id=None)[source]#

create a dataframe from a section of an RPT file

Parameters:
  • rpt_path – path to rep file

  • section – title of section to extract

  • element_id – type of element when extracting time series data

Returns:

pd.DataFrame

swmmio.utils.dataframes.get_inp_options_df(inp_path)[source]#

Parse ONLY the OPTIONS section of the inp file into a dataframe

Parameters:

inp_path – path to inp file

Returns:

pandas.DataFrame

>>> from swmmio.tests.data import MODEL_FULL_FEATURES_XY
>>> ops = get_inp_options_df(MODEL_FULL_FEATURES_XY)
>>> ops[:3]
                Value
Key
FLOW_UNITS        CFS
INFILTRATION   HORTON
FLOW_ROUTING  DYNWAVE

for use in an df.apply, to get coordinates of a conduit/link

swmmio.utils.dataframes.nodexy(row)[source]#