python codes for data prepration