ts_grid_tools.py 文件源码

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

项目:xarray_filters 作者: ContinuumIO 项目源码 文件源码
def ts_probs(dset, bins=None, axis=0, dim=None, layer=None,
             log_counts=False, log_probs=False, names=None,
             keep_attrs=True, chunks=None):
    '''Fixed or unevenly spaced histogram binning for
    the time dimension of a 3-D cube DataArray in X
    Parameters:
        dset: MLDataset
        axis: Integer like 0, 1, 2 to indicate which is the time axis of cube
        layer: The name of the DataArray in MLDataset to run scipy.describe on
        bins: Passed to np.histogram
        log_probs: Return probabilities associated with log counts? True / False
    '''
    layer = _validate_layer(dset, layer)
    def each_arr(arr, layer):
        return resize_each_1d_slice(arr, _hist_1d, bins=bins,
                        axis=axis, dim=dim, layer=layer,
                        log_counts=log_counts,
                        log_probs=log_probs,
                        names=names,
                        keep_attrs=keep_attrs,
                        chunks=chunks)
    return concat_ml_features(*(each_arr(dset[_], layer) for _ in layer))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号