HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
rust-ndarray
ndarray
Rust2015–2023
rust-ndarray / ndarray

ndarray

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations

7Distinct people
7Mentions
0Explicit recommenders
4.3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

ndarray: an N-dimensional array with array views, multidimensional slicing, and efficient operations

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 11:56:56 AM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year7 dated mentions

Observed mentions: 2015-06-02 06:08:30 UTC to 2023-09-22 20:51:18 UTC.

01232015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20152016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2023

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC101
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC303
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC000
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC000
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC101
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC000
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC000
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC101

What Hacker News says

7 sources
I would love some examples of how to do non-trivial data interop between Rust and Python. My experience is that PyO3/Maturin is excellent when converting between simple datatypes but conversions get difficult when there are non-standard types, e.g. Python Numpy arrays or Rust ndarrays or whatever other custom thing. Polars seems to have a good model where it uses the Arrow in memory format, which has implementations in Python and Rust, and makes a lot of the ndarray stuff easier. However, if the Rust libraries are not written with Arrow first, they become quite hard to work with. For example, there are many libraries written with https://github.com/rust-ndarray/ndarray, which is challenging to interop with Numpy. (I am not an expert at all, please correct me if my characterizations are wrong!)
In Some reasons to avoid Cython
I use this crate extensively and while I have gotten good results, it is not ergonomic and it is not equivalent to numpy ndarray. There are a lot of issues and work still to be done. Just a word of caution for anyone interested in using it. Things like windowing, slicing, views are all “supported” but have many limitations and are non intuitive. In particular, I needed an “axis shift” fn and I ended up spending hours scouring docs just to find a way to shift along an axis. When I mean by shift is a roll in numpy, ala: https://github.com/rust-ndarray/ndarray/issues/281 Answer: you can’t with this crate. I implemented a dynamic n-dim solution myself but it uses views of integer indices that get copied to a new array, which have indexes to another flattened array in order to avoid duplication of possibly massive amounts of n-dimensional
Read the rest
data; using the crate alone, copying all the array data would be unavoidable. Ultimately I’ve had to make my own axis shifting and windowing mechanisms. But the crate is still a useful lib and continuing effort. While I don’t mind getting into the weeds, these kinds of side efforts can really impact context focus so it’s just something to be aware of.
In The Illustrated Stable Diffusion
Your solution(s) is at least 1000x funnier and more beautiful than than R. H. Hardin's. Every one of his solutions starts with, "This sentence" and ends with a semi-predictable `permutation`. Your manual solution-interestingness-validation step, paired with its chaotic letter-space-fitness-searcher-generator (c), gave more interesting word combos. Way cool! Thanks! Your ability to work more freely within the same word space shows you have a better grasp of the spatial information density, and you've put together a better handle on solving it. Like you said though, "the space of possible solutions is truly astronomical." I think the only reason why this is even possible or remotely effective is that you can, in parallel, do high depth searches on a machine. One would be dead in the water without a searchlight, having to find a solution
Read the rest
at any more primitive a level. But, I wonder if you could operationalize other things with an algorithm for this search space and put it into a library which would have multiple dependent packages, solving many use cases. I'd imagine this work could adapt to other geometric, high-depth, higher-value searchable spaces. It seems similar to Markov-chain Monte Carlo, "pre-mined" / "rainbow tabled"... it has multiple solutions. Perhaps a good palce to start would be in constructing these lookup tables using lexicographical matrices, from a dictionary. I believe Rust has a powerful library to do this https://github.com/rust-ndarray/ndarray Looks like this is called matrix-notated, linear prediction. https://en.wikipedia.org/wiki/Linear_predictor_function#Matr... It seems that developers out there are thinking about complex probabilstic data structures, ie https://www.reddit.com/r/rust/comments/ailgpb/ann_matrix_exp... , so I bet these might even start combining soon.. what a matrix of possibilities, right? Which imagination hat sizes do you have in stock?
In Autograms: Self-enumerating Sentences
I started writing a test case, and discovered that crate "algebloat" won't even compile on stable rust 1.14.0. (It uses features "rustc_private" and "test".) It looks like this crate was never finished. This is the other problem with not having built-in multidimensional arrays. There are so many implementations to choose from. Here's the list of all 34 Rust matrix math packages.[1] Looking at crate "matrixmultiply", it's all unsafe code.[2] That's because it's C written in Rust: pub unsafe fn sgemm( m: usize, k: usize, n: usize, alpha: f32, a: *const f32, rsa: isize, csa: isize, b: *const f32, rsb: isize, csb: isize, beta: f32, c: *mut f32, rsc: isize, csc: isize) Arrays? What arrays? Raw pointers are good enough, right? What could possibly go wrong? Still trying to find a package with
Read the rest
a matrix multiply in safe Rust code with the subscript checks optimized out. Update: checked crate "ndarray". Indexing is unsafe.[3] Update: checked crate "matrices". Empty project. Update: Checked "scirust" - more raw pointer manipulation.[4] Not finding real-world matrix libraries in which all those fantastic checking optimizations are used and working. I'd like to see that stuff in action. [1] https://libraries.io/search?keywords=matrix&languages=Rust [2] https://docs.rs/crate/matrixmultiply/0.1.13/source/src/gemm.... [3] https://github.com/bluss/rust-ndarray/blob/master/src/dimens... [4] https://github.com/indigits/scirust/blob/master/src/matrix/m...
In Four years with Rust
> I don't know the particular multidimensional array discussion you experienced, but evolving a language takes slow time, and meanwhile people experiment with what is possible out-of-tree, like with the ndarray library, which seems to be well respected. A Fortran-like multidimensional library could effectively happen out of tree, but ndarray is closer to Python's numpy.ndarray than to Fortran arrays. And this means that ndarray can not support negative indexing (see here: https://github.com/bluss/rust-ndarray/issues/152). I started a prototype of Fortran like array here: https://github.com/Luthaf/mudi, if anyone want to look at the code or even work on this. My only problem at the time was that `Index` must always return a reference, and cannot return a new struct. From my understanding, this could be solved with the HKT/ATC work. > Right
Read the rest
now there is a focus on SIMD in Rust, which is crucial for this domain, so there is progress being made. This is very exciting! And knowing the Rust community, we may even get a cross-platform cross-architecture SIMD library with a nice API!
In Why physicists still use Fortran
Thanks! Rusty-machine doesn't really solve the same problems as leaf so there would certainly be some value in both existing. I agree on the linear algebra front too! I think it's well worth investing time into. Though - there are some other alternatives you may want to check out: nalgebra: https://github.com/sebcrozet/nalgebra ndarray: https://github.com/bluss/rust-ndarray (a little light on linear algebra right now) And there are probably a few others.
In Show HN: Machine learning (entirely) in Rust
I.e. like C++'s eigen or Python's numpy? I'm sure that Rust and Go can take the same approach: implement it in libraries. E.g. https://github.com/bluss/rust-ndarray is a Rust library for it. I'm sure you'll be sad that this takes `unsafe` to do performantly, but embedding it in the language is no different (the burden of proof just switches from "is this code safe" to "is the code that this code generates safe", and the latter is a harder question).
In Solving Linear Range Checks

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.