Data Science · मराठी आवृत्ती
4.2 dtype: array मध्ये कोणत्या प्रकारचा data आहे?
| dtype | उपयोग |
|---|---|
| int64 / int32 | Counts आणि qty |
| float64 | Amounts आणि minutes |
| bool | True/False flags |
| object | मिश्र प्रकार / text; numeric operations पेक्षा slow असू शकतो |
Number दिसणारी value text मध्येही असू शकते. गणित करण्याआधी convert करा:
amount_txt = np.array(["64", "90", "240"])
# wrong for math — convert:
amount_num = amount_txt.astype(float)
print(amount_num.sum())