deflex.DeflexScenario.check_input_data

DeflexScenario.check_input_data()

Check the input data for NaN values. If warning is True (default: False) a warning for all tables is raised that contain NaN values. This is useful if you suspect many NaN values in your data set, so you get a good overview over all the corrupt columns. Otherwise an exception is raised on the first occurrence of NaN values.

Examples

>>> import deflex as dflx
>>> fn = dflx.fetch_test_files("de02_no-heat_csv")
>>> sc = dflx.create_scenario(fn, "csv")
>>> sc.input_data["electricity demand series"].iloc[15] = float("nan")
>>> sc.input_data["volatile series"].iloc[11] = float("nan")
>>> sc.check_input_data()  # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
...
ValueError: NaN values found in the following tables: electricity...