You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Darren Schroeder edited this page Dec 5, 2018
·
2 revisions
Syntax in C# :
// from more abstract NumPy objectvarnp=newNumPy<int>();varlist=newint[]{1,2,3};varn=np.array(list);// from 2 to 3 in 5 steps with direct NDArray constructorvarnp1=newNDArray<double>().linspace(2.0,3.0,5);// using Matrix inversion and multiplication NDArray<double>np1=newNDArray<double>().arange(4).reshape(2,2);NDArray<double>np1Inv=np1.inv();varOncesMatrix=np1.dot(np1Inv);// convolvevarseries1=newNDArray<double>().array(newdouble[]{1,2,3});varseries2=newNDArray<double>().array(newdouble[]{0,1,0.5});varseries3=series1.Convolve(series2);
Syntax in Ironpython
# first need to add the NumSharp.Python.dll (at moment need to compile by yourself with dotnet build)importclr.AddReferenceToFileAndPath('./NumSharp.Python.dll')
# the wrapper class is called numpy ;)importnumpyasnp# standarda=np.arange(15).reshape(3, 5)
a.ToString()
# from Ironpython lista=np.array([2,3,4])
# select dtypec=np.array( [1,2,3,4], np.complex ).reshape(2,2)
#inv matrixA=np.array([1,2,3,4]).reshape(2,2)
matrixA_inv=matrixA.inv()
onces=matrixA.dot(matrixA_inv)