結果 : case when equivalent in python