diff --git a/array_copying.py b/array_copying.py index e61a325..12c2213 100644 --- a/array_copying.py +++ b/array_copying.py @@ -13,6 +13,7 @@ sales_data_2021 = np.array([[350, 420, 380, 410], [270, 320, 290, 310]]) # Create a copy of sales_data_2021 sales_data_2022 = np.copy(sales_data_2021) # Assign the NumPy array with elements 390 and 370 to the correct slice -sales_data_2022[0, -2:] = np.array([390, 370]) +sales_data_2022[0, -2:] = np.array([360, 420]) # Modify 1st element, Q3 & Q4 +sales_data_2022[1, :2] = np.array([280, 330]) # Modify 2nd element, Q1 & Q2 print(f'Quarterly sales in 2021:\n{sales_data_2021}') -print(f'Quarterly sales in 2022:\n{sales_data_2022}') \ No newline at end of file +print(f'Quarterly revised sales in 2022:\n{sales_data_2022}') \ No newline at end of file