<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_mean(data_np):
 """Calculate mean for valid values. Parameters data_np : ndarray Input array. Returns ------- result : float Mean of array values that are finite. If array contains no finite values, returns NaN. """

    i = np.isfinite(data_np)
    if not np.any(i):
        return np.nan
    return np.mean(data_np[i])