med-mastodon.com is one of the many independent Mastodon servers you can use to participate in the fediverse.
Medical community on Mastodon

Administered by:

Server stats:

361
active users

#numpy

2 posts2 participants0 posts today

Ugh great.

I sing mild praises of #Python documentation, but when it comes to third party libraries like #NumPy and especially #SciPy the documentation ranges from less than stellar to utterly atrocious.

And now I have a problem: scipy.optimize.fsolve() is throwing a numpy DeprecationWarning: Conversion of an array with nim > 0 to a scalar is deprecated.

The function I'm passing in to fsolve() returns a scalar!! And I'm already extracting index 0 from the return of fsolve!! WTF???

🗣️ Announcing Python-Blosc2 3.6.1

!Unlock new levels of data manipulation with Blosc2! 🚀

We've introduced a major improvement: powerful fancy indexing and orthogonal indexing for Blosc2 arrays.

We've tamed the complexity of fancy indexing to make it intuitive, efficient, and consistent with NumPy's behavior. 💪

Read all about it on our blog! 📝 blosc.org/posts/blosc2-fancy-i

Compress Better, Compute Bigger!

🚀 Great news for OpenMP on Python!

NumPy 2.3 includes early OpenMP support, making sorting operations like np.sort and np.argsort faster by using multiple processor cores — a big step for performance!

🛠️ This new feature is off by default but can be turned on during installation with -Denable_openmp=true

This marks the beginning of more parallel computing support in NumPy!

phoronix.com/news/NumPy-2.3-Re

www.phoronix.comNumPy 2.3 Introduces OpenMP Parallelization Support

If you're writing python libraries, DON'T REQUIRE fileno ON FILE OBJECTS!

Dealing w/ the bullshit that numpy.fromfile wants the fileno attribute on a file object. Yes, it's slightly faster, but it also makes it harder to mock when doing testing.

Now I'm going to have to deal w/ creating a temporary directory, writing the file, and cleaning up afterward. Things that unittest.TestCase should have an option to do, but doesn't. Luckily I've dealt w/ this BS before, so I'll just copy the code from another project.

Since I couldn't figure out how to use numpy.take, and LLMs couldn't figure out how to do what I needed to do, I read the numpy slicing chapter, and I came up with the following:
indexes = np.arange(W * H)
rgb[0, i].flat = c[0].flat[np.array(reps[i].flat) * (W * H) + indexes]

EDIT: it was broken, needed to add in the position index and simplification.

#Guix practitioners, I am planning which direction to prioritise in the next Python and Golang team updates, anything on your list to include?

As I started the MOOC by #Inria I've noted that Singularity is a nice candidate to bring to the containers collection, from the first glance it doesn't have too many dependencies (compared with Kubo...) github.com/sylabs/singularity/

For Python, stabilise the chain of #NumPy and try to figure out how to migrate to V2 issues.guix.gnu.org/76240

GitHubsingularity/go.mod at main · sylabs/singularitySingularityCE is the Community Edition of Singularity, an open source container platform designed to be simple, fast, and secure. - sylabs/singularity

Is it possible to do gradient descent in python without using numpy. Numpy array is a very strange animal that can result in unexpected results if you try to do some manipulation that other libraries, such as Matplotlib, don't like. On the other hand, python is a bad language for people who want to do simple affine transformation with arrays. Python list is not array and does not allow you to do addition or multiplication. And #python list and #Numpy ndarray are incompatible animals. #AI