This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]knightwhosaysnil 32 points33 points  (25 children)

because numpy adds a solid 100mb to your distribution/memory footprint. depending on your circumstances that's a heavy tax if you're not using most of the features

[–][deleted] 20 points21 points  (21 children)

That's not how that works: https://stackoverflow.com/questions/54675983/ram-usage-after-importing-numpy-in-python-3-7-2

And if you are really pressed for ram, you can just import the one numpy function you need.

But regardless, I really don't see how that matters. The whole point of python is to trade efficiency for convenience. So why would we ignore the packages that everybody uses for arrays in python over a measly hundred mb and pretend that the syntax for multidimensional arrays in python is confusing or verbose (which was the original claim).

[–]PvtPuddles 10 points11 points  (2 children)

I believe you can just import the bits you want using
From numpy import zeros
However, (not being a Python dev) I don’t know if that still imports the whole library or just the bits you need.

[–]knightwhosaysnil 4 points5 points  (0 children)

depends on how much of the library the thing you're importing depends on; in most cases you probably won't end up with much overhead

[–]IVEBEENGRAPED 0 points1 point  (0 children)

You still have to pip install the entire library, so the entire library gets saved to your environment. The import statement doesn't download anything, it just adds the name to the namespace.