#Numpy

2025-05-18

🐍 I don’t like NumPy

「 NumPy is all about applying operations to arrays. When the arrays have 2 or fewer dimensions, everything is fine. But if you’re doing something even mildly complicated, you inevitably find yourself with some operation you want to apply to some dimensions of array A, some other dimensions of array B, and some other dimensions of array C. And NumPy has no theory for how to express that 」

dynomight.net/numpy/

#numpy #python

GripNewsGripNews
2025-05-16

🌕 我不喜歡 NumPy
➤ NumPy 的設計缺陷與未來陣列語言的期望
dynomight.net/numpy/
作者表達了對 NumPy 的不滿,儘管它在科學計算領域非常流行。文章指出 NumPy 在處理高維度陣列和複雜操作時,其語法變得晦澀難懂,缺乏清晰的邏輯,且難以調試。作者認為 NumPy 早期移除索引並採用廣播機制是一個設計上的錯誤,導致了許多複雜問題。儘管 NumPy 提供瞭如 `np.einsum` 等優秀功能,但整體而言,其缺乏直觀性和可讀性,使得程式碼難以理解和維護。作者提倡一種更清晰、更易於理解的陣列操作語言。
+ 我一直覺得 NumPy 的用法有點反直覺,這篇文章說出了我的困擾!
+ 雖然 NumPy 有些缺點,但它仍然是數據科學領域不可或缺的工具,作者的批判或許有些過於嚴厲。

N-gated Hacker Newsngate
2025-05-15

🚨 Breaking News: 🚨 Shockingly, a disgruntled ex-lover of writes an entire novel on how they once adored this array-wrangling behemoth but now can't seem to stand its indexing anymore. 📉 At least we know Python can still compute the boundless irony of someone hating something so influential. 😂
dynomight.net/numpy/

Yaksh BariyaCodingThunder
2025-05-15

To all the / folks on mastodon, how do you guys think in numpy? It seems like quite a challenging task to me

Aron Gergelyarongergely
2025-05-15

For raster masters:

use QgsRasterLayer.as_numpy() to get your raster layer as numpy array.

This was silently added in QGIS v3.40,
thus no one seems to know!

see qgis.org/pyqgis/3.40/core/QgsR

2025-05-14

Создаем интерактивную симуляцию лесного пожара на Python с использованием клеточных автоматов

Лесные пожары – явление столь же древнее, сколь и сама жизнь на суше. Величественные и одновременно ужасающие, они способны за считанные часы превратить гектары зеленого массива в выжженную пустыню, неся угрозу экосистемам, человеческим поселениям и климату планеты. Ежегодно новости пестрят сообщениями о новых очагах возгорания, о борьбе стихии и человека. Но что если мы попытаемся заглянуть в самое сердце этого хаотичного, на первый взгляд, процесса? Что если мы сможем не просто наблюдать, а моделировать, предсказывать и даже экспериментировать с распространением огня, не выходя из-за своего компьютера?

habr.com/ru/articles/909322/

#клеточные_автоматы #пожары #python #симуляция #pygame #numpy #природные_катастрофы #симуляция_физики

2025-05-12
dr 🛠️🛰️📡🎧:blobfoxcomputer:davidr@hachyderm.io
2025-05-02

I've been working on a #space #visualization tool for our operators. It basically needs to always know, and be ready to plot, where every single one of 60k+ objects is down to millidegree/meter/second resolution just in case the sensor suddenly slews there

My own constraint is that it has to be 1) a single 2) #python executable because otherwise I'm not interested

Earlier this year, I found a great 30x faster technique for determining which #satellites are above the horizon. (In fact, it's far more general than that, but that's all the help it gives me to this problem.)

I also realized I could spawn a #multiprocessing child to do lookahead on data and then pass a huge #numpy array to my graphing process. (Investigated ~9 different ways, chose the best)

But there I was stuck.

At any given moment, there are ~4500 space objects above the horizon (at our latitude). Putting 4500 points with little persistence trails and labels and then updating all that at 1Hz let alone the 10Hz I'd like was taking too long, even using the amazing #pyqtgraph

So there I was stuck. Until this week.

2025-04-28

I upgraded archeryutils to use #numpy #typing more 'properly'.
I found the docs and other sources challenging when it came to implementation and examples, so here are my observations and an #ELI5 summary of the bits I felt were missing in the hope it might help others: jackatkinson.net/post/numpy_ty

Comments welcome.
#Python #SoftwareEngineering

Sharlatansharlatan
2025-04-25

For Python pro, how to package any projects depending on Numpy properly when 1 and 2 versions are not compatible. I tried NixOS way or Gentoo way but didn't get it.

danzindanzin
2025-04-22

Do you maintain or contribute to a package that includes a C extension? Would you like to run a fuzzer against it?

If so, let me know and I will run it, or help you to get it running.

The fuzzer is , which generates random code calling into your functions and methods. It's useful to check for crashes on invalid inputs or unexpected call patterns.

It has found about 50 crashes in , 20 in , 6 in etc.


See here:
github.com/devdanzin/fusil/iss

Sharlatansharlatan
2025-04-19

Me, trying to refresh to 7.0+ in which needs 3.11 and 2.0+

2025-04-19

PostgreSQL Shared Libraries: Solving Python Extension Library Path Issues
Smoothly integrate Python extensions with PostgreSQL Shared Libraries, especially when using NumPy. Properly configuring the `shared_libraries` parameter prevents runtime errors by ensuring your database server can locate necessary libraries. Learn how to manage PostgreSQL Shared Libraries for robust Python extensions!
tech-champion.com/databas...

InterData VNinterdatavn
2025-04-17

NumPy là gì? A-Z về thư viện NumPy trong hệ sinh thái Python

NumPy là một thư viện cực kỳ mạnh mẽ trong Python, nổi bật với khả năng xử lý mảng dữ liệu đa chiều một cách nhanh chóng và hiệu quả. Đây là công cụ không thể thiếu trong khoa học dữ liệu, lập trình và học máy. Bài viết này sẽ giới thiệu về các tính năng nổi bật của NumPy, các hàm phổ biến và những ứng dụng thực tế của thư viện này.

Xem ngay: interdata.vn/blog/numpy-la-gi/

2025-04-09

@aethrvmn

I'm not really saying they do. I was more making fun of myself there.

As a kid I did #assembly - first without an assembler using paper and debug (enter 0000 for all jumps until you know their addresses, write down in notebook, go back and adjust.. save to .com)

Then C.

Swore anything higher level was lazy and wrong.

Then basically learned #Python in my 30's - it felt wrong, but #numpy, #theano, so..

Now #Rust - makes me nostalgic for old stubborn ways. And for C.

#rustlang

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst