window.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:PyDataLondon29-EmbarrassinglyParallelDAWithAWSLambda 作者: SignalMedia 项目源码 文件源码
def _prep_window(self, **kwargs):
        """ provide validation for our window type, return the window """
        window = self._get_window()

        if isinstance(window, (list, tuple, np.ndarray)):
            return com._asarray_tuplesafe(window).astype(float)
        elif com.is_integer(window):
            try:
                import scipy.signal as sig
            except ImportError:
                raise ImportError('Please install scipy to generate window '
                                  'weight')
            # the below may pop from kwargs
            win_type = _validate_win_type(self.win_type, kwargs)
            return sig.get_window(win_type, window).astype(float)

        raise ValueError('Invalid window %s' % str(window))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号