Python codes for data analysis