Hacker News new | ask | show | jobs
by andreasvc 4258 days ago
I think if you would use memory views you could have the benefits of both fast low level access, plus the vectorized numpy functions on the other hand (I'm thinking here of initializing the arrays with a single call to numpy.random.uniform). With multi-dimensional arrays it's definitely better than plain pointers.
1 comments

Well, as you know, if I'm using a multi-dimensional array, it's usually super sparse! (Because NLP). So I want to define those myself, not use the numpy ones.

Maybe I just never learned numpy. But I had to go and look up what that stuff did, and it wasn't obvious to me what the data types of those arrays would be. So, I like the C-style initialization actually --- just because it's more obvious to me.