import math


def replace_nans_with_zeros(list_of_numbers: list):
    """Replaces any NaN present in a list with 0.
    Args: a list of floats and which optionally contains NaNs
    Returns: a list of floats
    """

    for counter, i in enumerate(list_of_numbers):
        if math.isnan(i):
            list_of_numbers[counter] = 0.0
    return list_of_numbers