Can Python#39;s set absence of ordering be considered random order?(Python 设置的无序是否可以被视为随机序?)
问题描述
我想知道 Python 内置 set 结构中缺少元素排序是否足够随机".例如,取一个集合的迭代器,是否可以将其视为其元素的混洗视图?
I'd like to know if the absence of element ordering of the Python's built-in set structure is "random enough". For instance, taking the iterator of a set, can it be considered a shuffled view of its elements?
(如果重要的话,我在 Windows 主机上运行 Python 2.6.5.)
(If it matters, I'm running Python 2.6.5 on a Windows host.)
推荐答案
不,它不是随机的.它是任意排序的",这意味着您不能依赖它是有序的还是随机的.
No, it is not random. It is "arbitrarily ordered", which means that you cannot depend on it being either ordered or random.
这篇关于Python 设置的无序是否可以被视为随机序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Python 设置的无序是否可以被视为随机序?
基础教程推荐
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 包装空间模型 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
