« first day (3574 days earlier)      last day (1357 days later) » 

12:23 AM
Discussion specific to the Python tag on meta: meta.stackoverflow.com/q/399850/541136
 
 
1 hour later…
1:26 AM
@AaronHall See my comments there. It seems very hard to get the meta brigade to stick to the topic, sigh... the question was clearly asked about [python] tag not SO in general. The anti-patterns among [python] askers are fairly easy to spot, to anyone who bothers to look. We might have to move this over to MetaPython
 
@smci well, the context was the Python tag but the answers should be general enough to apply to the rest of the site in my opinion. I just answered it myself...
 
@smci I wonder how hard it would be to write something to auto dupe, or (more likely) train some machine learning/AI on previously duped/closed questions and have it alerting us about them, since we're probably not supposed to let it loose as it's own user, however accurate it is.
[That said, per the comments on that post, it'ld be 99% accurate by cv-ing everything by default.]
 
@toonarmycaptain Less risky to say "automatically suggest which dupe". The short answer is quite hard, see posts by several of us including me about that for the last two years, my stuff was mainly about pandas. But more fundamentally, SO itself can and should write the tools to detect and fix patterns of abuse. We're not on SO's payroll. There's a limit to volunteer goodwill, time and energy, when the site shifts its priorities to maximizing revenue and eyeballs, at the expense of quality; ...
... but that was already debated to death throughout 2019.
 
No argument there. I suspect that such a tool might be more viable for python than some other tags, though.
Looking in meta and seeing people nostalgic for what chat was makes me feel guilty for not being as present as I was.
 
1:40 AM
@toonarmycaptain What is our individual motivation, and what is the business case, if SO decides to open the $$$ floodgates to well-known patterns of abuse, i.e. askers and respondents farming a sea of LQ? Like the apocryphal tale of King Canute, we might as well bid the waves to recede...
 
hey
 
@Janith cbg
@smci No argument here. Apart from competing personal time demands, part of the reason I'm less active on the Q/A side is that there seem to be few questions that are both difficult to dupe and within my skillset/time constraints to answer well.
Cnut did alright against the Celts though.
 
2:07 AM
Hey I'm using a var with type(bytes), a first for everything.
 
2:58 AM
@PaulMcG I used these methods today!
 
@AndrasDeak I am going to start using that name :) cbg
 
@toonarmycaptain They are pretty handy!
 
3:42 AM
@PaulMcG I might end up going back and slimming down a bunch of tests, if I get around to it.
 
3:56 AM
@toonarmycaptain I'm a Celt, but I'm also a Toon Army fan...
 
@smci I've got fans?! xD
 
4:20 AM
@toonarmycaptain Nah the football team, mon.
 
If I install python from source will I still get IDLE (on a mac)? I dont want IDLE, I also dont want to go the conda route, so much modules that I dont even use
What I am expecting here is just python with stdlibs
 
4:39 AM
@smci Aye mon, ah noo.
 
 
2 hours later…
6:45 AM
@python_learner It should be trivial to configure/run the build so only python gets built and installed - just see the build instructions. (And anyway it wouldn't really matter if IDLE also got built or installed, you don't need to use it. Or you could delete it).
@toonarmycaptain Have you got any good grim jokes about Newcastle's 13th-place finish this season? At least the town has a sense of humour about itself, football, and life.
 
7:01 AM
All, I propose that Sample datasets in Pandas be added to the SO Canon. Is that ok? It's a basic ingredient for MCVE that we can readily access sample datasets. (This is actually one thing that R does much better than Python/pandas)
 
Can anyone here please help me understand why my recent question stackoverflow.com/questions/63147963/… is getting downvoted into oblivion and what I could do to improve the quality of the question? One of the comments says "Show your code" but I am not sure how to approach the problem (and thereby write any code), therefore I derived and posted a minimal problem statement in the question.
 
@PratyushDas be aware that so is not a code writing service. If you don't know how to approach the problem, people will be biased against your question, because a it implies a) you haven't tried solving it, b) you haven't researched solving it c) if you did a and b you likely do not understand your own question well enough, and there will be lots of back and forth to hammer down details you did not think about. That is the general part.
 
Ah okay. That makes sense. Thanks.
 
In specific, since you already have a related question, there is some basis to expect that you try to transfer its answers to the new problem. You at least be able to come with an almost-solution to the new problem based on the old one.
Kudos for asking how to improve, by the way.
 
Thanks! :)
 
 
1 hour later…
8:22 AM
@python_learner IDLE is bundled with python, just like pip – technically, it is part of the stdlib. There are some custom bundles that skip parts (e.g. many Linux distros skip pip) but they are usually a pain because assumptions are broken. IDLE is not that large (unlike the anaconda stack), so you are likely better off to just ignore it.
FWIW, I manage my python installations using brew. Never realised whether IDLE was there or not, until I needed it to debug someone's code (that only bugged out on IDLE).
 
Just to add; there is also Miniconda so you don't necessarily have to get the full package list to use conda
 
8:51 AM
Good point: nice to save space when storage matters.
[prepares for backlog refinement meeting with sense of dread]
 
9:19 AM
Hi Guys! Can anyone tell me whether there's a formal name for this: if __name__ == '__main__'
 
I'm not sure it has one. I've just gone through the multiprocessing docs to see if they use one because I knew they'd need to mention it there and I can't spot any formal-looking terms
I think I've seen it referred to as "guard" or "shield" but I probably wouldn't know what you were talking about without context, so that doesn't really fit the bill
 
@SayandipDutta there doesn't seem to be one. I commonly know it as "main guard".
Interestingly enough, googling "main guard" provides __name__ == '__main__' results even if the page does not use the "main guard" term.
 
Interesting. Well I was actually writing a module, and in few function docstrings I would have liked to refer the reader to the "Main Guard" part for example. Now I am not sure whether including the term "Main Guard" would help them or confuse them further :P
By module I mean a dumping place for common utility functions.
 
That would probably be enough context for me to understand what you're referring to. I meant more along the lines of someone just saying "list comprehensions" and I immediately know what that entails. "main guard" shall be my terminology henceforth
 
9:41 AM
Yep, same here. Going to push it hard :) Thanks
 
9:52 AM
Can someone have a look at this question? https://stackoverflow.com/questions/63099006/changing-marker-sizes-in-matplotlibs-legend-when-using-tuples-for-markers
Thanks
 
@DarthV what is the original value of lgnd.legendHandles[1]._sizes?
(And note that relying on "private" attributes is risky, it might break with a future version)
If the attr is array-valued with length 2 you could assign [200, 400] to it
 
@AndrasDeak It is 101.36004841
 
@DarthV ah...
Then I won't be able to help until I'm in front of a laptop
 
@AndrasDeak I tried it, apparently. It didn't work. In case you figure it out, kindly share it under the linked question. Thank you.
*using [200,400] didn't work
 
10:08 AM
Hi, is it possible to update python dict dynamically with a set of data as in this snippet gist.github.com/prashanth-sams/a7207b997a93fc4717f115fffcfc0ed3
I get keyerror when I try to push a key which is not there in the template
 
You possibly want something like a defaultdict or a template dictionary to populate, but you have several levels of nesting and it's not clear from your question which level throws the error
 
it throws error in the 3rd level; I placed a comment in that gist
 
@PrashanthSams Is there a reason why you are using a dict with keys of 0, 1, ... instead of a list?
 
Hi @MisterMiyagi, I want to populate a json data; so I feel like dict is convenient
so, I can have multiple tree formatted values
the gist I provided is an example
 
I don't really get the argument here. Just take note that JSON supports both lists and dicts.
 
10:18 AM
Yes, but lists are also valid in JSON
 
I dont know that list is better in this case; I will take this point to go ahead
 
Anyway, I started trying to play with defaultdict and I think I'm just being too fancy and needing to turn to lambda. I suspect the cleanest way forward is to just use dict.get() to see whether the entry exists and handle that in an if/ else
Readability counts for more than what I was trying to concoct to look smart
 
ah okay
Thank you @roganjosh; nice suggesstion; will try
 
there's also dict.setdefault to safely get-or-set a value.
e.g. self.json_data['content']['suites'].setdefault(1, {})['name'] = 'suite1'
 
@MisterMiyagi at that point you're probably better off with an arbitrarily nestable defaultdict
 
10:27 AM
@MisterMiyagi I was thinking that, but then we'd still need to wrap in a function to pass the 1 to be extensible, and the inner dict has other keys so I dropped it at that point
I suppose if it's just a single other key then it wouldn't be too bad
 
@AndrasDeak Could be. I assume there's some Z to the X's Y here, anyways.
Since I'm just about to throw pyparsing at the equivalent of "read one value from /proc", I'll refrain from pointing fingers at seemingly overcomplicated approaches. At least for the next few hours.
 
11:21 AM
Hi
i can't run tensorflow in PyCharm. Which versions of Python, Pycharm and Tensorflow will work togehter?
 
11:36 AM
okay it is working now
 
12:11 PM
df_singlef = merged_item.loc[(merged_item['SKU Screening']==1) & (merged_item['Shipping Fee (Paid By Customer)']==0) & ((merged_item['Shipping Fee Paid by Seller'] + merged_item["Auto. Shipping fee subsidy"] + merged_item["Shipping Fee Voucher"]) <-80)]
 
@Pherdindy ...yes?
 
Sometimes when a dataframe column is not present due to the data not having it such as absence of the ['Shipping Fee (Paid By Customer)'] column, it will error. How do I circumvent this?
 
@Pherdindy define the index ahead of time, and use an if to create the final mask
take the sure-to-exist columns first, protect the rest with ifs
you can also gather the components in a list (again, conditionally in case of missing columns) and then call np.logical_and on the list at the end
 
@AndrasDeak the if will be before that line of code right or is there a way to build it in the statement?
But none note of this issue
 
@Pherdindy no way that will be readable
 
12:18 PM
So basically i'll create some code to check which columns are available beforehand
Before I run the filter
Was just checking if there was like a try/except kind of behavior I can use haha
 
You can; before the indexing operation
 
12:32 PM
@Pherdindy because it's a code smell when you don't know the structure of your dataframe ahead of time
Missing data is normal; missing columns aren't
 
1:09 PM
does someone know a dupe for "why (how not) list/tuple/... uses repr on its elements?"
 
@AndrasDeak you're right maybe the dataframe has to be restructured
yup definitely bad structure didn't think of that
 
23 hours ago, by LinkBerest
Then I use CoreNLP (a Java library) through wrappers and Spark for other things. I use Gensim when I have to deal with topic modeling and similarity stuff. And sometimes use TextBlob when I need a simple task or to teach. Also, just straight Python w/numpy and/or pandas for other stuff (sometimes Scikit).
The one that starts with a G is pretty good at that
 
2:05 PM
@smci We finished above Sunderland, evil eye or no? I got nothing, you?
 
2:21 PM
Hello All
 
 
2 hours later…
4:33 PM
According to this I can vote to delete with 10k rep: stackoverflow.com/help/privileges/moderator-tools
So how do I do it?
 
A "delete" button will show up next to the "close"/"reopen" button if a question is eligible for deletion
 
@NicolasGervais find a question that's been closed at least 48 hours ago
 
Ah, ok. Thanks guys. So there is no new review queue for me?
 
nope
stackoverflow.com/tools is as close to a review queue there is. It shows delvotes you're eligible to in a different colour if I recall correctly
that page also shows 20k-deletable things (questions closed less than 2 days ago but with -3 score or less, and answers with negative score) that have gathered a delvote
 
5:27 PM
Does anyone know what's the time complexity of scipy.spatial algorithm?
 
5:57 PM
n(o)
 
 
1 hour later…
 
2 hours later…
8:50 PM
Similar to the license discussion a few days back; does anyone have a "favourite" GDPR rundown in relation to cookies? I think this is a pretty genuine question, even if it's not a great fit for SO
I'd quite like to have my own decent rundown on what the legislation forces, in addition to being able to leave them with it
 
Wonder if law.SE has anything
 
9:16 PM
Huh, TIL that Italy considers scrolling on a site to be active consent in the scope of GDPR. That's enough to tell me that there's no easy catch-all answer
3
Huh, TIL that The Europead Data Protection Board (EDPB) changed their guidelines to prevent scrolling being considered as active consent. I give up.
 
Heh
 

« first day (3574 days earlier)      last day (1357 days later) »