<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_nan(s, o):
 """ this functions removed the data from simulated and observed data whereever the observed data contains nan this is used by all other functions, otherwise they will produce nan as output """

    data = np.array([s.flatten(), o.flatten()])
    data = np.transpose(data)
    data = data[~np.isnan(data).any(1)]
    return data[:, 0], data[:, 1]