Refactor to create the data_array1 in python