跳到主内容
回到顶部
Ctrl
+
K
安装
教程
后端
参考
图库
开发者
发布版本
更多
指南
主页
GitHub
安装
教程
后端
参考
图库
开发者
发布版本
指南
主页
GitHub
章节导航
引言
图类型
算法
函数
图生成器
线性代数
与其他数据格式互相转换
节点重新标记
图的读写
绘图
随机性
异常
工具函数
arbitrary_element
flatten
make_list_of_ints
dict_to_numpy_array
pairwise
groups
create_random_state
create_py_random_state
nodes_equal
edges_equal
graphs_equal
UnionFind.union
powerlaw_sequence
cumulative_distribution
discrete_sequence
zipf_rv
random_weighted_sample
weighted_choice
open_file
not_implemented_for
nodes_or_number
np_random_state
py_random_state
networkx.utils.decorators.argmap
cuthill_mckee_ordering
reverse_cuthill_mckee_ordering
networkx.utils.mapped_queue.MappedQueue
后端
配置
术语表
参考
工具函数
weighted_choice
weighted_choice
#
weighted_choice
(
mapping
,
seed
=
None
)
[源代码]
#
从加权样本中返回单个元素。
输入是一个字典,键是项目,值是权重。
在此页面上
weighted_choice()