Mik*_*298 0 python equality comparison-operators
我需要比较大于等于的 if 语句的两个值。
if delta_t > tao_threshhold:
n = np.random.normal(0, 1)
rxn_vector = propensity*delta_t + (propensity*delta_t)**0.5*n
new_popul_num = popul_num
Run Code Online (Sandbox Code Playgroud)
但我需要平等远远大于。在数学中使用的符号是 >> 但这在 Python 语法中意味着完全不同的东西。
有没有办法表达这比 Python 中的平等大得多?
干杯
小智 5
我认为“远大于”的想法在很大程度上取决于用例或个人偏好。回答你的问题;你需要知道“比”你想要的“多多少”:
假设我想检查 delta_t 是否比 tao_threshhold 大 5 倍;我会做这样的事情:
if delta_t > 5*tao_threshhold:
Run Code Online (Sandbox Code Playgroud)
但是再次解决这个问题的方法在于一个明确定义的“远大于”的概念