My soul left my body at ‘pandas as tf.’
Exactly my reaction. Tf?
The fuk?
I am not data scientist and this offends me
This is just pure evil
I actually did import torch as tf3, really fucks with people’s mind
Team Fortress 3 confirmed!!
Titanfall 3 ?!!
Where's hl3?
Alas, I don't think we have managed to import that yet.
import hail as hl3
Honest question but why is it so common in python anyways to use the import as statement and import pandas for example as pd. In pretty much every other language the equivalent to import as is just used in edge cases and everything they importer as is to not confuse people. I’ve never understood that because in the case you don’t want to type that many characters autocomplete exists so it shouldn’t be an issue to type pandas as a whole word.
it mostly applies to only pandas, numpy, and matplotlib.pyplot. all other libraries are usually imported as they already are
Yes but why those? Why is it so common to import those like that?
i dunno. it's a tradition at this point. i mean, we use indents instead of braces, you may have more important questions to ask
Yeah the indent thing is shit too but that’s just a design decision from the language designer. The shortening of pandas and so on is basically a community decision which is way more interesting to question. At least for me.
Because those libraries are intended for scientists rather than programmers.
If you look at code in other languages written by scientists/mathematicians, you'll also see tons of needlessly shortened variables names. Often just x and y.
Reasons vary, part of it is how they think about problems. Holdover from pen and paper research where var names were shortened to one letter to save manual effort. Part is that this community were some of the earliest programmers, when memory was so scarce that you'd want to save every byte, even in the source code.
Python with numpy and all stands out because none of the practical concerns remain, but the culture persists and looks a bit absurd.
Thx. Makes sense
Tbf, typing pandas every time is goofy af.
I mean with at least an average autocomplete it shouldn’t be sufficient to type pa or at most pan and it autocompletes to pandas. And then even people who are not familiar with the convention would know that the library used is pandas.
int
but not integer
?” I think most developers will prefer int
, unless you are using cobol, basic, or pascalMakes sense. But I want to add two things. You don’t need an ide for autocomplete. Every acceptable editor should be able to do it and if not it’s just not suitable for coding tbh. Also many big languages uses the full words like string integer and Boolean like for example Java which is still a widely used language or typescript uses the full names too.
It's the data science folks I'm pretty sure. I didn't start seeing this pattern of proactive re-aliasing of libraries until I started to get into the ML world. And then I started seeing awful things like variables named 'x' and other traditional programmer eye twitching code. By now I've gotten fairly used to it in this space, but it still drives me nuts when I have to correct either imports or usage of some LLM-generated code.
Why do you want to type out numpy.array, etc when you can shorten it to np.array?
Also if you use these libraries, you will usually use many symbols, so it makes more sense to import the entire module than to import only some symbols.
Because people that are not familiar with the lib and the convention would immediately see what lib was used.
Why do you want to type out numpy.array, etc when you can shorten it to np.array?
Also if you use these libraries, you will usually use many symbols, so it makes more sense to import the entire module than to import only some symbols.
Just when i thought i wasn't capable of murder....
```
```
This is fucking eyebleach , i saw this 10 minutes ago and now cant think properly now
not really familiar. is it the initials being mixed up?
Yeah. These are all packages that are VERY frequently imported using well-known aliases, to the extent that people will refer to "np.xyz" without even bothering to mention that they imported numpy as np. I'm sure you can figure out which name NORMALLY goes with which alias here.
Yea. Those are some very standard libraries for data science and it is almost a standard to use those aliases. If you see code that does not use those standard aliases such as using the full name, you know it is someone who does not know what they are doing.
OR, they refuse to follow the arbitrary rules enforced by the community. Because they can 🤣
Or they learned Python after learning other stuff and before this shit became common
Yep, it's the import aliases — totally messed up. Like using plt for TensorFlow or np for matplotlib. Pure chaos for any data scientist.
Pure chaos for very dumb people tho...
I get that's just a joke, but if that was a real life scenario the dumbest dev in the world would prolly get a clue about right clicking this shit and refactor with the correct alias.
This is harmless lol
train = X[:]
test = X[-500:]
Ahhhhhhhhhhhhhh
Kids were bullied around my block for this kind of behaviour
This is not offensive, but will be a pain in the ass!
Ew
Import depression as yes
import satan as jesus
Just got put on Interpol's most wanted list holy fuk
Where is the california proposition 65 label when this is the ONE PLACE where that would be appropriate?
...I just want to hurt something right now...
My soul entered attack mode for about 2 seconds there
This isn’t just wrong. It’s illegal in 42 countries