frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Why did not numpy copy the J rank concept?

14•jrank•7mo ago
Recently there was a post [1] about numpy being not easy to work with when using arrays of shape greater than 2.

  One of the problems mentioned in [1] is that  you can not use python loops because they are slow.  In J you can solve for example 100 equations using the rank concept, this is a simple  example:

   a=: 2 2 $ 1 1 1 _1
   b=: 10 2 $ ? 20 # 10
   solutions =: b %. "(1 _) a
That code solve the systems a * v_i = b_i for ten random vectors. I think a similar concept could be developed in numpy. The syntax "(1 _)" indicates to take the rows from the left operator and all (_ is infinite) of a apply solve (that is %. in J). In this case the system is x+y=y0, x-y=y1.

So I would suggest somthing like numpy.linalg.solve(a,b,rank=(1,inf))

[1] https://news.ycombinator.com/item?id=43996431

Comments

tester89•7mo ago
The question you're asking seems interesting, but I don't understand J code so I don't know what you're talking about. Expanding the explanation would be helpful!
jrank•7mo ago
If you have a a Numpy function that takes for example two arguments, my proposal is to add a optional argument that allows that function to be applied to cells of dimensions i and j by function_name(a,b,range=(i,j)) so that the function is applied to subarrays of dimension i of a and subarrays of dimension j of b to create a new array. The broadcast operation and the axis arguments are not a general solution. I J you have such mechanism as the example shows.

The 1 cell of a matrix are the rows, etc.

gus_massa•7mo ago
I'm still confused. Can you type the complete slow python code?

We had a weird multiplication last year and the solution in python was to use @guvectorize https://numba.pydata.org/numba-doc/dev/user/vectorize.html and broadcasting. I don't know if that's possible with your problem.

jrank•7mo ago
guvectorize in numba seems to be a good approximation to the rank concept I mentioned, but is not a complete solution. Unfortunately I don't have the time now to study it and make a complete comparison, but guvectorize is in the good direction. Thanks for providing that information.
Pompidou•7mo ago
Maybe the internal broadcasting mecanism in numpy don't allow this nativelly ?
jrank•7mo ago
The post I referenced before shows that broadcast is not a general solution.

Teaching Mathematics

https://www.karlin.mff.cuni.cz/~spurny/doc/articles/arnold.htm
1•samuel246•2m ago•0 comments

3D Printed Microfluidic Multiplexing [video]

https://www.youtube.com/watch?v=VZ2ZcOzLnGg
1•downboots•2m ago•0 comments

Abstractions Are in the Eye of the Beholder

https://software.rajivprab.com/2019/08/29/abstractions-are-in-the-eye-of-the-beholder/
1•whack•2m ago•0 comments

Show HN: Routed Attention – 75-99% savings by routing between O(N) and O(N²)

https://zenodo.org/records/18518956
1•MikeBee•3m ago•0 comments

We didn't ask for this internet – Ezra Klein show [video]

https://www.youtube.com/shorts/ve02F0gyfjY
1•softwaredoug•4m ago•0 comments

The AI Talent War Is for Plumbers and Electricians

https://www.wired.com/story/why-there-arent-enough-electricians-and-plumbers-to-build-ai-data-cen...
1•geox•6m ago•0 comments

Show HN: MimiClaw, OpenClaw(Clawdbot)on $5 Chips

https://github.com/memovai/mimiclaw
1•ssslvky1•6m ago•0 comments

I Maintain My Blog in the Age of Agents

https://www.jerpint.io/blog/2026-02-07-how-i-maintain-my-blog-in-the-age-of-agents/
2•jerpint•7m ago•0 comments

The Fall of the Nerds

https://www.noahpinion.blog/p/the-fall-of-the-nerds
1•otoolep•8m ago•0 comments

I'm 15 and built a free tool for reading Greek/Latin texts. Would love feedback

https://the-lexicon-project.netlify.app/
1•breadwithjam•11m ago•1 comments

How close is AI to taking my job?

https://epoch.ai/gradient-updates/how-close-is-ai-to-taking-my-job
1•cjbarber•12m ago•0 comments

You are the reason I am not reviewing this PR

https://github.com/NixOS/nixpkgs/pull/479442
2•midzer•13m ago•1 comments

Show HN: FamilyMemories.video – Turn static old photos into 5s AI videos

https://familymemories.video
1•tareq_•15m ago•0 comments

How Meta Made Linux a Planet-Scale Load Balancer

https://softwarefrontier.substack.com/p/how-meta-turned-the-linux-kernel
1•CortexFlow•15m ago•0 comments

A Turing Test for AI Coding

https://t-cadet.github.io/programming-wisdom/#2026-02-06-a-turing-test-for-ai-coding
2•phi-system•15m ago•0 comments

How to Identify and Eliminate Unused AWS Resources

https://medium.com/@vkelk/how-to-identify-and-eliminate-unused-aws-resources-b0e2040b4de8
2•vkelk•16m ago•0 comments

A2CDVI – HDMI output from from the Apple IIc's digital video output connector

https://github.com/MrTechGadget/A2C_DVI_SMD
2•mmoogle•17m ago•0 comments

CLI for Common Playwright Actions

https://github.com/microsoft/playwright-cli
3•saikatsg•18m ago•0 comments

Would you use an e-commerce platform that shares transaction fees with users?

https://moondala.one/
1•HamoodBahzar•19m ago•1 comments

Show HN: SafeClaw – a way to manage multiple Claude Code instances in containers

https://github.com/ykdojo/safeclaw
2•ykdojo•22m ago•0 comments

The Future of the Global Open-Source AI Ecosystem: From DeepSeek to AI+

https://huggingface.co/blog/huggingface/one-year-since-the-deepseek-moment-blog-3
3•gmays•23m ago•0 comments

The Evolution of the Interface

https://www.asktog.com/columns/038MacUITrends.html
2•dhruv3006•25m ago•1 comments

Azure: Virtual network routing appliance overview

https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-routing-appliance-overview
2•mariuz•25m ago•0 comments

Seedance2 – multi-shot AI video generation

https://www.genstory.app/story-template/seedance2-ai-story-generator
2•RyanMu•28m ago•1 comments

Πfs – The Data-Free Filesystem

https://github.com/philipl/pifs
2•ravenical•32m ago•0 comments

Go-busybox: A sandboxable port of busybox for AI agents

https://github.com/rcarmo/go-busybox
3•rcarmo•32m ago•0 comments

Quantization-Aware Distillation for NVFP4 Inference Accuracy Recovery [pdf]

https://research.nvidia.com/labs/nemotron/files/NVFP4-QAD-Report.pdf
2•gmays•33m ago•0 comments

xAI Merger Poses Bigger Threat to OpenAI, Anthropic

https://www.bloomberg.com/news/newsletters/2026-02-03/musk-s-xai-merger-poses-bigger-threat-to-op...
2•andsoitis•33m ago•0 comments

Atlas Airborne (Boston Dynamics and RAI Institute) [video]

https://www.youtube.com/watch?v=UNorxwlZlFk
2•lysace•34m ago•0 comments

Zen Tools

http://postmake.io/zen-list
2•Malfunction92•37m ago•0 comments