考虑两个1-dim数组,一个包含要从中选择的项,另一个包含绘制另一个列表项的概率.
items = ["a", 2, 5, "h", "hello", 3] weights = [0.1, 0.1, 0.2, 0.2, 0.1, 0.3]
在朱莉娅,怎么能随意在选择项目items使用weights对重量绘图给定项目的概率是多少?
items
weights
arrays random random-sample julia
arrays ×1
julia ×1
random ×1
random-sample ×1