def zero_pad(data, count, right=True):
    """
    Parameters
    --------
    data : (n,)
      1D array
    count : int
      Minimum length of result array

    Returns
    --------
    padded : (m,)
      1D array where m >= count
    """
    if len(data) == 0:
        return np.zeros(count)
    elif len(data) < count:
        padded = np.zeros(count)
        if right:
            padded[-len(data):] = data
        else:
            padded[:len(data)] = data
        return padded
    else:
        return np.asanyarray(data)
Parameters
    --------
    data : (n,)
      1D array
    count : int
      Minimum length of result array

    Returns
    --------
    padded : (m,)
      1D array where m >= count