I'm trying to convert NumPy/python code to CPP/xtensor. I have difficulty converting the following statement.
data = pd.read_csv(input_file,sep=',')
v = data.values
x = v[1:]/v[:-1]
LX1 = np.log(x[t-(2*w) + 1:t - w + 1,:]) <=== how do I write this in cpp
How would I write this in xtensor?
Slicing in xtensor can be done with views.
In python:
In c++, with xtensor:
Logs in xtensor can be performed with
xt::log()
You can also check conversions from numpy to xtensor in the From numpy to xtensor section.