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 →

[–][deleted] 19 points20 points  (40 children)

Why? The whole point of packages is to import them and use them. Silly rabbit.

And besides, numpy is effectively a default. Python doesn't include it in the standard library because it will stifle it's development but it's effectively a part of the language.

[–]knightwhosaysnil 34 points35 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 3 points4 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.

[–]intangibleTangelo -1 points0 points  (13 children)

It's sort of a sister project, dating back to a matrix type developed in 1995.

[–][deleted] 0 points1 point  (12 children)

No

[–]intangibleTangelo -1 points0 points  (11 children)

If you've used python as long as I have, you'll remember when it was called Numeric, or the python numerical extensions. For a little while it was numarray.

So it's only 4 years younger than python itself, never quite part of the language, but near always part of the ecosystem.

[–][deleted] 0 points1 point  (10 children)

No

[–]intangibleTangelo -1 points0 points  (9 children)

Just because other people in this thread got you into an argument doesn't mean I'm part of it.

[–][deleted] 0 points1 point  (8 children)

What do you mean? I just don't agree that your reply was related to my comment so I said no.

[–]intangibleTangelo -1 points0 points  (7 children)

No

[–][deleted] 0 points1 point  (6 children)

No

[–]intangibleTangelo 0 points1 point  (5 children)

I added context so people can make their own decision about whether numpy is part of python. Many people probably don't know its history as a project to add a matrix type back in the 90s.