Live data from Hacker News

Array Programming with NumPy

nature.com

71–80 of 114 posts

Re: Array Programming with NumPy

#71
post #35

Let's not forget to give at least some credit to Perl Data Langauge (PDL). It pioneered a lot of these ideas 10 years before NumPy existed, and is still a pretty great tool today: http://pdl.perl.org/index.php?page=FirstSteps

NumPy’s direct predecessor Numeric was released in 1995.

Re: Array Programming with NumPy

#72

Earlier quoted context omitted.

Theoretically Julia is better for scientific computing, the only issue is its package ecosystem isn't as mature as Python's. But it's growing incredibly fast and there have already been libraries available for a few years that would be really impractical to write and maintain at such a level in C++ for Python. I assume that for science at least Julia will catch on a lot.

Julia interop with Python is insanely easy. using PyCall np = pyimport("numpy") res = np.fft.fft(rand(ComplexF64, 10)) You just called numpy fft from Julia.

Yes, and the interface is pretty fast and without any noticeable overhead:

julia> data = rand(ComplexF64, 1024^2);

# python fft from julia:

julia> res = @btime np.fft.fft(data);

  78.613 ms (39 allocations: 16.00 MiB)
# python fft in ipython:

In [11]: %timeit res = np.fft.fft(data)

89.3 ms ± 1.65 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)

As expected, julia has its own fft package (based on FFTW):

julia> res = @btime fft(data);

  61.540 ms (33 allocations: 16.00 MiB)

Re: Array Programming with NumPy

#73
post #5

As someone who cut his teeth on bioinformatics before eventually just completing a full computer science degree, I was a bit worried that this article wouldn’t address the applied scientific audience well. Pleasantly surprised, though, at how well this article evangelizes NumPy to that exact community. Many labs are gaining access to or creating physical tools that create data analysis over experimental design proble…

The coolest thing I read last year was about single cell rna-seq trajectory analysis of the differentiation for different blood cells.

You might like the mass cytometry reconstruction of the human haematopoietic system [1]. I've done a bit of scRNA-seq and mass cytometry, and the issue I have with scRNA-seq is the tiny dynamic range it has compared to flow/mass cytometry, which can make identifying populations much harder. Not to mention the cost!

[1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3273988/figure/...

Re: Array Programming with NumPy

#74
post #48

Earlier quoted context omitted.

I started using python and numpy/scipy back then because it was vastly easier to deploy on a server or supercomputer. The matlab compiler meanwhile is clunky and adds new bugs and additional steps. Julia doesn't really match python in this regard either. For more pure research and prototyping things both can do, I still think matlab is better though I rarely use it. I just like the idea of being able to easily deploy…

In Julia, there is one package manager and it gets things right. https://docs.julialang.org/en/v1/stdlib/Pkg/ It's super nice to have no fragmentation when it comes to packaging. In Pkg, package states are immutable, always reproducible, and quick. Julia packages that have binary dependencies usually build them all for every platform using the binary builder infrastructure ( https://github.com/JuliaPackaging/Yggdrasi…

I also like that package environments are integrated in Julia and thus there is only one way handle environments.

Re: Array Programming with NumPy

#75
post #28

Don't underestimate the impact this has on getting funding or even just tenure/etc recognition for working on numpy. I'm in industry these days, but coming from the academic side, it's _really_ hard to get recognized for building the underlying infrastructure that tons of people use. I've built and maintained libraries that are used in a ton of publications, but was always told my work was "utterly and completely use…

props to your work and similar to numpy, i assume it has been immensely useful for loads of people. but 'building the underlying infrastructure that tons of people use' is not science. in my department we had to fail a phd student because 90% of his work was just implementing bunch of existing methods as a python library. useful, yes; science, no. wasn't his fault, had a shitty supervisor, but making useful tools is…

That's quite the wrong way of approaching science. The scientific method is based on building on the shoulders of giants. Those giants aren't the professors in the direct vicinity nor are they only the papers you cite. The whole of the process is science and if we need further specialization for building better tools (hey, maths and statistics are scientific tools as well) I would classify that as science to a large extent.

What could be useful is openness in used tools and software and a way of getting citation counts for software used. It's nothing more than a table. That way the hotness of publication could start to flow for the underlying tools.

Re: Array Programming with NumPy

#76
post #35

Let's not forget to give at least some credit to Perl Data Langauge (PDL). It pioneered a lot of these ideas 10 years before NumPy existed, and is still a pretty great tool today: http://pdl.perl.org/index.php?page=FirstSteps

NumPy’s direct predecessor Numeric was released in 1995.

... and then in 2001 or so, numarray came about and was supposed to be better - but instead it sort of split the community and wasted resources.

Then Travis started Numpy which somehow magically was backward compatible with both numeric and numarray - and managed to get the community united again.

Re: Array Programming with NumPy

#77
Numpy array syntax inconsistent to the degree it can be considered broken. For instance, to take elements number 4,3,2 of an array in Python, one writes A[3:0:-1], but for the elements 3,2,1 one has to write A[2::-1], because someone decided that making A[-1] refer to the last element of an array is "intuitive", and so A[2:-1:-1] will return empty slice.

Now if you want to use array comprehensions, the first case looks similar: [A[k] for k in range(3,0,-1)] but the second now has to be [A[k] for k in range(2,-1,-1)].

Further, for some reason, array and matrix are different types and one has to convert back and forth between them.

Re: Array Programming with NumPy

#78
post #29

Earlier quoted context omitted.

Theoretically Julia is better for scientific computing, the only issue is its package ecosystem isn't as mature as Python's. But it's growing incredibly fast and there have already been libraries available for a few years that would be really impractical to write and maintain at such a level in C++ for Python. I assume that for science at least Julia will catch on a lot.

> Theoretically Julia is better for scientific computing, the only issue is its package ecosystem isn't as mature as Python's. That's not a small issue. The ecosystem is probably the reason people choose NumPy over MATLAB, for example. NumPy is not inherently superior to MATLAB, and most academicians that adopted NumPy in the 2000's already had a MATLAB license, so cost was not a concern either.

> That's not a small issue.

In fact, it's not an issue at all since Julias ecosystem is a superset of that of Python: with PyCall you can use Python libraries and Julia libraries in one program without issues.

Re: Array Programming with NumPy

#79
post #28

Don't underestimate the impact this has on getting funding or even just tenure/etc recognition for working on numpy. I'm in industry these days, but coming from the academic side, it's _really_ hard to get recognized for building the underlying infrastructure that tons of people use. I've built and maintained libraries that are used in a ton of publications, but was always told my work was "utterly and completely use…

This so much. I cannot stress enough what an impact various python developments have had on the economy as a whole. Sometimes the right tools can inspire people and that’s exactly what happened.

Re: Array Programming with NumPy

#80
post #28

Don't underestimate the impact this has on getting funding or even just tenure/etc recognition for working on numpy. I'm in industry these days, but coming from the academic side, it's _really_ hard to get recognized for building the underlying infrastructure that tons of people use. I've built and maintained libraries that are used in a ton of publications, but was always told my work was "utterly and completely use…

props to your work and similar to numpy, i assume it has been immensely useful for loads of people. but 'building the underlying infrastructure that tons of people use' is not science. in my department we had to fail a phd student because 90% of his work was just implementing bunch of existing methods as a python library. useful, yes; science, no. wasn't his fault, had a shitty supervisor, but making useful tools is…

I am really sorry but most “science” coming out of even the top institutions these days are sadly uninspired garbage regurgitations.
Post reply on HN