<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _winsorize_wrapper(x, limits):
 """ Wraps scipy winsorize function to drop na's """

    if isinstance(x, pd.Series):
        if x.count() == 0:
            return x

        notnanx = ~np.isnan(x)
        x[notnanx] = scipy.stats.mstats.winsorize(x[notnanx],
                                                  limits=limits)
        return x
    else:
        return scipy.stats.mstats.winsorize(x, limits=limits)