this post was submitted on 13 Jun 2023
85 points (98.9% liked)
Programmer Humor
32571 readers
370 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Not a programmer, y funny?
When doing "import x as y", x is the library (set of tools you can use in your program) you import and y is what you would call it throughout your code. This is helpful to shorten things, for example "import numpy as np". Now you can just write "np" instead of "numpy".
In the image you would start every numpy statement with "pandas" and every pandas statement with "numpy". It just makes it confusing.
numpy
andpandas
are two different modules that have similar uses, but are most definitely not interchangeable. Line 500 is importingnumpy
, but calling itpandas
. Meaning later on in the code, any time the script makes use ofnumpy
, it actually has to refer to it aspandas
, and vice versa, causing all sorts of confusion and shenanigans.I feel like there should be an award for the most interesting error code, regardless of how highly subjective that is.
Think of replacing the word "and" with the word "or", and vise versa. Typically it will still make sense, bot not always