We're pretty attentive to what people are asking in here. If nobody has responded it's probably because they're not familiar with PyQt. I'm certainly not.
Don't take silence as a sign nobody is reading your question :)
If you have a more general question, I may be able to help
Apologies for the screenshot, I'm on a remote connection and copy/paste isn't working. But how it is possible to get a traceback that doesn't report a single line of my own code? Even following through the other exceptions, I can't see my calling code postimg.cc/K3rrJHzX
It looks like requests is using a thread pool and somehow it seems to be detached from my calling code. Unfortunately, I make multiple requests in that script and I don't know which one is failing
mmm, looks like it's being thrown by a ReadTimeout and I hadn't handled that case, the traceback in that case is a bit wonky but at least I can now fix it :)
hei! hello, I have a problem with Numpy: I have a z=np.ndarray((500,10)) and I have a numpy array i of shape (500,) that I want to use as indices for the rows of z. In particular, I want to access the first row of z with the first element of i, the second row of z with the second element of i and so on. Then I want to set those element to 0. Do you know the correct expression?
So I'm supposed to come up with a project using Django for a software development course in Universe(2 month Project). I'm not sure as to what to go about doing. Look for ideas. Could anyone give me a few good suggestions?
So... I went for a full scale test due to a peculiar annoying bug I had: where an application on a server (backgrounprocess) would just hang after running for 3-5 days. Without any error nor large memory footprint, yet kept using (very little) cpu and just sitting there. (If I didn't know better I would think this is due to a race condition). Now after more than a week testing the same application, with the only difference it being not ran inside alpine linux but just ubuntu works smoothly without any problem at all.
I've got an ordered list of floats, and a single float x. I'd like to find the float in the list that is closest to x. I can do this with bisection, but is there a more efficient solution?
Maybe if I pre-prepare the list in some way... The list's data stays constant throughout the execution of the program, but x will have ~1500 different values
I don't think I can beat O(ln(n)) for a single lookup, but maybe there's some amortization magic I can invoke over multiple lookups
I assume searchsorted basically iterates over a and v in tandem, resulting in O(a+v) time. That might be better than my current approach's O(log(a)*v).
This function is a faster version of the builtin python `bisect.bisect_left`
(``side='left'``) and `bisect.bisect_right` (``side='right'``) functions,
which is also vectorized in the `v` argument.
Maybe you could split your sorted list into multiple smaller sorted lists with specific bounds? Like one list for all floats between 0 and 10, another list for all floats between 10 and 20, etc. You can instantly find the correct bin for each float with a floor division, and then you only need to bisect the numbers in that specific bin
All of my floats are between 0 and 1, so I can definitely bin them. But I don't expect it to be much faster, since then I'm switching out binary search for N-ary search, where N is the number of bins.
In order to populate my model, I have to parse 17 different Excel files. They've just given me the data for next year and they've changed the format of all the different sheets. At this point I just want to sit in a corner and cry.
This is one of the most eggregious data breaches ever and highlights #supplyChain risk. Vendor stops paying rent, warehouse seizes servers and sells them (with data) unaltered. Millions of records, including plaintext passwords, already sold. Wow.
Just about got pyparsing moved over from SF to GitHub - only took me 18 months of nailbiting before getting help - sometimes you can be dependent on the kindness of strangers
One interesting insight I got was in some critique of my unit tests, which were described as overly complex, as the user was looking for some pretty basic API call-response tests.
Then I realized he was actually looking at them from an instructional perspective, as an alternative to wading through my unorganized examples directory.
"Unit tests as intro docs" was something I'd not thought of before
On a recent question, I asked for an MCVE despite my crystal ball showing me a very clear picture of what the problem was, and which turned out to be right. I probably would have gotten more points if I had shot from the hip.
@Kevin Heads up: That OP is the proud owner of multiple user accounts and their question is sitting at a score of -1, so your answer and your rep may disappear at any moment
Conversely, I was asked for an MCVE just yesterday, when I felt that my post of what I had tried (in the absence of a fully runnable example) was sufficient to describe my question.
Oh well. In any case, I have acquired a piece of knowledge that I did not have before. Namely, that calling namedtuple twice with identical arguments won't produce identical types.
In the sense that you can't use those values interchangeably in an isinstance call and expect the same result for both
namedtuple is figuring prominently in my simple_unit_tests test specification pattern, btw - I'm liking the use of defaults to fill in noop parts of a test.
I like the idea of lightweight declaration of plain-old-data classes, but in practice I just use dicts
Currently annoyed by Python : Operator with pair of values for skip because the behavior of slicing is entirely implementation-dependent and OP didn't mention what the object's type was
I'm off to compose my own Matrix class that deletes your hard drive if you pass it a tuple containing a slice object
It seems to be getting more common that numpy is just considered base Python and not tagged. At least Pandas stands out a bit more if it's missing the tag
Years ago I tossed off one of those "act on contiguous groups in numpy by using cumulative/diff tricks" answers. We've all done a million of them, and there are a dozen variations of the same basic tricks. Answered it and never thought about it again, because I typically use pandas and not bare numpy, where we have groupby to play with and so things are usually a little easier.
I certainly didn't expect someone would write up a Youtube tutorial on the answer. (?!)
Since the Youtuber in question is also using pandas I think he's just making things harder for himself than it needs to be, but I admire the spirit. Plus it's kind of interesting to see how a non-expert looks at the sort of vectorization tricks numpy users do as a matter of course.
If he hadn't put "DSM" in the title it wouldn't have shown up, so I lucked out there. I have to admit I then spent fifteen minutes trying to see if there were any others, but couldn't find any.
I'm in packaging hell right now. I'm attempting to build a distribution to be installed via a conda channel. As I run conda-build I run up against name_of_my_module cannot depend on itself I've been looking all through this thing and cannot find where or what is making this happen. Just throwing this out there in the hopes someone as seen something like this.
Listen, just because I think a select group of people with a certain intrinsic quality, high intellect, special skills, or experience are more likely to be constructive to society as a whole, and therefore deserve influence or authority greater than that of others, doesn't mean I'm elitist
Self-deleted posts can be viewed and undeleted by their original authors. However, self-deleted questions cannot be edited by their authors unless undeleted first for spam prevention reasons. Self-deleted answers can be edited by the author without undeleting.
meta.stackexchange.com/questions/296101/… explains that if editing-while-deleted were possible, spammers could post a question, delete it, wait for it to fall off the new questions queue, edit it into spam, and undelete it.
Seems a shame that we're denying privileges to good users in order to prevent bad users from having them too
I see a lot of upvotes on comments asking "Why not simply have the undelete event bump the question?", which appear to have fallen on deaf ears
I also wonder how prevalent this would be. Do spammers really sit around thinking "how do I make sure that my spam gets the least amount of attention possible?"?
(yeah, yeah, "they're actually asking 'what's the most amount of attention I can get without drawing the attention of people with the power to remove my post?'". You know what I mean.)
I really need to learn chat tools beyond mashing my hands at a keyboard to spout opinions :/ Andras will have to find his code bowling example. Trigger warning: it is scary
I don't know if I agree with even half of PEP 8, but I prefer mediocre consistency over the diversity of a million codebases with bold new ideas about what looks good
I've come to the opinion that regexes are good for a certain category of problem whose complexity lies between "actually, you can do this with ordinary string methods" and "actually, you need to write a full parser"
The "now you have two problems" gag might still apply if you're bad at identifying where those borders are though