dot_to_dot_plotter.py 文件源码

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

项目:Robo-Plot 作者: JackBuck 项目源码 文件源码
def _try_compute_mode(objects):
    """
    Computes the mode of a set of object, if a unique such exists.

    Args:
        objects (list[T]): the object whose mode is to be computed

    Returns:
        T: the modal value, or None if a unique mode does not exist
    """
    try:
        numeric_value = statistics.mode(objects)  # This _is_ 'None' friendly
    except statistics.StatisticsError:  # No unique value, or empty data
        numeric_value = None
    return numeric_value
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号