當前位置: 首頁>>代碼示例>>Python>>正文


Python MA.greater_equal方法代碼示例

本文整理匯總了Python中MA.greater_equal方法的典型用法代碼示例。如果您正苦於以下問題:Python MA.greater_equal方法的具體用法?Python MA.greater_equal怎麽用?Python MA.greater_equal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在MA的用法示例。


在下文中一共展示了MA.greater_equal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: agegrp

# 需要導入模塊: import MA [as 別名]
# 或者: from MA import greater_equal [as 別名]
def agegrp(age):
    agrp = MA.choose(MA.greater_equal(age, 85), (age, -18.0))
    agrp = MA.choose(MA.greater_equal(agrp, 80), (agrp, -17.0))
    agrp = MA.choose(MA.greater_equal(agrp, 75), (agrp, -16.0))
    agrp = MA.choose(MA.greater_equal(agrp, 70), (agrp, -15.0))
    agrp = MA.choose(MA.greater_equal(agrp, 65), (agrp, -14.0))
    agrp = MA.choose(MA.greater_equal(agrp, 60), (agrp, -13.0))
    agrp = MA.choose(MA.greater_equal(agrp, 55), (agrp, -12.0))
    agrp = MA.choose(MA.greater_equal(agrp, 50), (agrp, -11.0))
    agrp = MA.choose(MA.greater_equal(agrp, 45), (agrp, -10.0))
    agrp = MA.choose(MA.greater_equal(agrp, 40), (agrp, -9.0))
    agrp = MA.choose(MA.greater_equal(agrp, 35), (agrp, -8.0))
    agrp = MA.choose(MA.greater_equal(agrp, 30), (agrp, -7.0))
    agrp = MA.choose(MA.greater_equal(agrp, 25), (agrp, -6.0))
    agrp = MA.choose(MA.greater_equal(agrp, 20), (agrp, -5.0))
    agrp = MA.choose(MA.greater_equal(agrp, 15), (agrp, -4.0))
    agrp = MA.choose(MA.greater_equal(agrp, 10), (agrp, -3.0))
    agrp = MA.choose(MA.greater_equal(agrp, 5), (agrp, -2.0))
    agrp = MA.choose(MA.greater_equal(agrp, 0), (agrp, -1.0))
    returnarray = -agrp.astype(MA.Int)
    return returnarray
開發者ID:timchurches,項目名稱:NetEpi-Analysis,代碼行數:23,代碼來源:epitools.py


注:本文中的MA.greater_equal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。