結果 : r code to python conversion