Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Detailed formatcheck.py documentation

echang97 edited this page Jun 26, 2019 · 23 revisions

add_item

Parameter(s):

  • key - Item to be added or modified
  • value - Unit of measurement to be associated with key
  • dictionary - The Dictionary that this is being applied to

If key is already in the dictionary, add the value to the set associated with the key

Otherwise, add the associate the new key with a new set containing only value

[Ex 1.] key = "Gas", value = "mcf" -> { "Gas": {"mcf"} }

[Ex 2.] key = "Geothermal - Electrical Generation", value = "Kilowatt Hours" -> { "Geothermal - Electrical Generation": {"Kilowatt Hours"} }

key = "Geothermal - Electrical Generation", value = "Thousands of Pounds" -> { "Geothermal - Electrical Generation": {"Kilowatt Hours", "Thousands of Pounds"} }

get_com_pro

Parameter(s):

  • cols - Columns from Pandas DataFrame Checks cols for "Commodity" or "Product"

Returns "n/a" if "Commodity" and "Product" are both present or both missing

Otherwise it returns whichever is present

Clone this wiki locally