Skip to content

Commit 5d2ea0a

Browse files
committed
update readme.
1 parent 9ada93c commit 5d2ea0a

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,24 @@ The NumPy class is a high-level abstraction of NDArray that allows NumSharp to b
4141
// init NumPy instance which pesists integer data type
4242
var np = new NumPy<int>();
4343
// create a 2-dimension vector
44-
var n = np.arange(12).reshape(3, 4);
44+
var nd = np.arange(12).reshape(3, 4);
4545
4646
// access data by index
47-
Assert.IsTrue(n[1, 1] == 5);
48-
Assert.IsTrue(n[2, 0] == 8);
47+
var data = nd[1, 1];
4948
5049
// create a 3-dimension vector
51-
n = np.arange(12).reshape(2, 3, 2);
50+
nd = np.arange(12).reshape(2, 3, 2);
5251
// get the 2nd vector in the 1st dimension
53-
var n1 = n.Vector(1);
54-
55-
Assert.IsTrue(n1[1, 1] == 9);
56-
Assert.IsTrue(n1[2, 1] == 11);
52+
data = n[new Shape(1)];
5753
5854
// get the 3rd vector in the (axis 1, axis 2) dimension
59-
var n2 = n.Vector(1, 2);
55+
data = n[new Shape(1, 2)];
6056
61-
Assert.IsTrue(n2[0] == 10);
62-
Assert.IsTrue(n2[1] == 11);
57+
// interate ndarray
58+
foreach (data in nd)
59+
{
60+
// data is a ndarray or a value
61+
}
6362
```
6463

6564
### Install NumSharp in NuGet
@@ -83,8 +82,10 @@ Reference the online [documents](https://numsharp.readthedocs.io).
8382

8483
NumSharp is referenced by:
8584
* [Pandas.NET](https://github.com/Oceania2018/Pandas.NET)
85+
* [SciSharp Learn](https://github.com/SciSharp/scisharp-learn)
8686
* [Bigtree.MachineLearning](https://github.com/Oceania2018/Bigtree.MachineLearning)
8787
* [CherubNLP](https://github.com/Oceania2018/CherubNLP)
8888
* [BotSharp](https://github.com/dotnetcore/BotSharp)
8989

90+
NumSharp is a member project of [SciSharp.org](https://github.com/SciSharp) which is the .NET based ecosystem of open-source software for mathematics, science, and engineering.
9091
Welcome to fork and pull request to add more APIs, and make reference list longer.

0 commit comments

Comments
 (0)