fix ratio in python need to change float before calculate