data_types.py 文件源码

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

项目:postpy 作者: portfoliome 项目源码 文件源码
def generate_numeric_range(items, lower_bound, upper_bound):
    """Generate postgresql numeric range and label for insertion.

    Parameters
    ----------
    items: iterable labels for ranges.
    lower_bound: numeric lower bound
    upper_bound: numeric upper bound
    """

    quantile_grid = create_quantiles(items, lower_bound, upper_bound)
    labels, bounds = (zip(*quantile_grid))
    ranges = ((label, NumericRange(*bound))
              for label, bound in zip(labels, bounds))
    return ranges
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号