# P12.3 NumPy Array गणित: पूर्ण Arrays ची बेरीज, गुणाकार आणि तुलना

Source: https://ravindrabagale.com/mr/datascience/py12-numpy-tutorial-for-beginners-arrays-math-and-filtering/p12-3-numpy-array-maths-add-multiply-and-compare.html
Language: mr (Marathi with English technical terms)

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

Qty × price सारखं गणित प्रत्येक row साठी हवं असतं.

हे काय आहे?

एकाच लांबीच्या दोन arrays वर +, -, *, / केलं की position नुसार गणित होतं. Comparison केलं की True/False चा array मिळतो.

कसं करायचं?

Step 1. दोन arrays घ्या.
Step 2. Operator लावा.
Step 3. np.round() ने गोल करा.

उदाहरण A: प्रत्येक row ची revenue

```python
import numpy as np
qty = np.array([3, 2, 5])
price = np.array([56, 40, 84])
revenue = qty * price
print(revenue)
print(revenue.sum())
```

Output:

```text
[168  80 420]
668
```

याचा अर्थ: qty * price ने प्रत्येक row ची revenue एकदम मिळाली.

उदाहरण B: Currency conversion आणि rounding

```python
import numpy as np
gbp = np.array([19.99, 45.50, 120.00])
eur = np.round(gbp * 1.17, 2)
print(eur)
```

Output:

```text
[ 23.39  53.24 140.4 ]
```

याचा अर्थ: पूर्ण array ला rate ने गुणून round केलं.

उदाहरण C: Percentage change

```python
import numpy as np
users = np.array([1000, 1150, 1100, 1320])
change = (users[1:] - users[:-1]) / users[:-1] * 100
print(np.round(change, 1))
```

Output:

```text
[15.  -4.3 20. ]
```

याचा अर्थ: (नवीन - जुनं) / जुनं × 100 पूर्ण array वर एकदम झालं.

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

"operands could not be broadcast together" आलं तर तुमच्या arrays ची लांबी वेगळी आहे. प्रत्येकाचा `.shape` print करा.
