MATLAB उपयोगकर्ताओं के लिए Python
Justin Kiggins
Product Manager
print(radius)
[[1, 2, 3]]
type(radius)
<class 'numpy.ndarray'>
area = np.pi * (radius ** 2)
print(area)
[3.14159265 12.56637061
28.27433388]
| Operation | Operator |
|---|---|
| Addition | + |
| Subtraction | - |
| Multiplication | * |
| Division | / |
| Exponentiation | ** |
type(revenue)
<class 'numpy.ndarray'>
print(revenue)
[[100, 114, 96, 120]]
type(cost)
<class 'numpy.ndarray'>
print(cost)
[102. 104. 101. 102.]
profit = revenue - cost
print(profit)
[-2. 10. -5. 18.]
import numpy as np
np.mean(revenue)
107.5
कुछ उपयोगी NumPy फंक्शन:
np.min() array में सबसे छोटा मान देता हैnp.max() array में सबसे बड़ा मान देता हैnp.sum() array के सभी मानों का योग देता हैMATLAB उपयोगकर्ताओं के लिए Python