import numpy as np
import rustynum as rnp
# Using Numpy
a = np.array([1.0, 2.0, 3.0, 4.0], dtype="float32")
a = a.reshape([4,1])
c = np.array([True, False, False, False])
a = a[c] + 2
print(a.mean())
# Using RustyNum
b = rnp.NumArray([1.0, 2.0, 3.0, 4.0], dtype="float32")
b = b.reshape([4,1])
d = rnp.NumArray([True, False, False, False], dtype="bool")
b = b[d] + 2
b = b + 2
print(b.mean().item())