I need to build two array so that every element is a 365-element array (separated in 30/31-element individual arrays) representing a calendar; the first array should contain the number of airplane flights that happen in a single day, and the second should contain the number of delayed flights in each day; every row in both arrays is supposed to contain such data for ONE specific Travel Agency.
I declared the arrays using the following code:
year = np.array([[0]*31,[0]*29,[0]*31,[0]*30,[0]*31,[0]*30,[0]*31,[0]*31,[0]*30,[0]*31,[0]*30,[0]*31,])
flights_1998_Carriers = np.array([year,]*14)
delays_1998_Carriers = np.array([year,]*14)
But whenever I increase the value of ONE specific day for a specific agency in one of the two arrays, the same day for EVERY agency in BOTH arrays is increased as well. For example:
print(flights_1998_Carriers[0][0][1])
print(delays_1998_Carriers[0][0][1])
flights_1998_Carriers[0][0][1] = flights_1998_Carriers[0][0][1] + 1
print(flights_1998_Carriers[0][0][1])
print(flights_1998_Carriers[1][0][1])
print(delays_1998_Carriers[0][0][1])
Would print the result:
0
0
1
1
1
I have tried everything I could think of but I can't understand WHY all the rows in both arrays are linked in such a way. Does anyone know where I'm messing this up? Thanks.