message_ix_models.tests.project.ssp.test_transport.insert_nans

message_ix_models.tests.project.ssp.test_transport.insert_nans(df: DataFrame, variable_expr: str, year_cond: Callable[[Hashable], bool]) DataFrame[source]

Replace zeros with np.nan in df.

This occurs only where:

  1. The ‘Variable’ column contains a string that matches variable_expr.

  2. The year_cond returns True for the column name.