# P12.6 NumPy 2D Arrays: Rows, Columns आणि Axis

Source: https://ravindrabagale.com/mr/datascience/py12-numpy-tutorial-for-beginners-arrays-math-and-filtering/p12-6-numpy-2d-arrays-rows-columns-and-axis.html
Language: mr (Marathi with English technical terms)

हे का शिकायचं?

Stores × weeks सारखा data table सारखा असतो — rows आणि columns.

हे काय आहे?

2D array म्हणजे lists ची list. arr[row, col] value देतो. axis=0 म्हणजे column नुसार (खाली), axis=1 म्हणजे row नुसार (आडवं).

कसं करायचं?

Step 1. np.array([[…], […]]) बनवा.
Step 2. shape तपासा.
Step 3. sum(axis=0) किंवा sum(axis=1).

उदाहरण A: बनवा आणि वाचा

```python
import numpy as np
orders = np.array([[120, 135, 128],
                   [210, 198, 225]])
print(orders.shape)
print(orders[1, 2])
print(orders[:, 0])
```

Output:

```text
(2, 3)
225
[120 210]
```

याचा अर्थ: shape ने rows आणि columns कळले.

उदाहरण B: Store नुसार आणि week नुसार totals

```python
import numpy as np
orders = np.array([[120, 135, 128],
                   [210, 198, 225]])
print("Per store:", orders.sum(axis=1))
print("Per week:", orders.sum(axis=0))
```

Output:

```text
Per store: [383 633]
Per week: [330 333 353]
```

याचा अर्थ: axis=1 ने प्रत्येक store चा आणि axis=0 ने प्रत्येक week चा total मिळाला.

रवींद्र बागले यांची tip

Axis असं लक्षात ठेवा: axis=0 rows एकत्र करतो (प्रत्येक column चं उत्तर), axis=1 columns एकत्र करतो (प्रत्येक row चं उत्तर).
