« first day (4278 days earlier)      last day (653 days later) » 

12:28 AM
Does anyone know which package plots these maps with inlaid locator maps showing where-in-the-world the area is? commons.wikimedia.org/wiki/…
@roganjosh Now that's what I call music...
 
12:44 AM
@smci great
@KarlKnechtel Sorry for not replying sooner, I forgot. Yeah, true.
I've never used it, but I did a quick search and found this package, I had another package in mind that I had heard that it might be useful for this type of task but I couldn't find it.
 
1:01 AM
hey guys anyone know deep learning i want simple question
0
Q: Compute derivatives with Pytorch

Mohamed FathallahI am trying to perform this backpropagation of Andrew using PyTorch, the weights are correct as when I multiple them with input I get 33 but I don't understand why it is 3 6 9 in Andrew's example and mine different a=torch.tensor(5,dtype=torch.float64) #i will consider those as training data b=t...

i don't understand why Andrew derivative not same as mine
 
@Marco I know geopandas well, I was asking how they do the small inlaid "locator map" (on some projection) at the top, e.g. Wikimedia: Benelux. They appear to be using Inkscape. See also graphicdesign.stackexchange.com/questions/tagged/inkscape , stackoverflow.com/questions/2054438/…
@MohamedFathallah By 'andrew', do you mean that's homework from the new 2022 version of the Coursea Deep Learning course? That's not really a programming problem. Not sure which SE site it should be on-topic on.
 
1:19 AM
@smci agreed with this fwiw.
 
1:40 AM
@smci Ok
 
@Marco Marco: No. It's not an algorithmic question or theoretical question about stats, hence it's also offtopic on CV. It's offtopic on AI. It's offtopic on DataScience.SE. I seriously meant what I wrote: "This is just numerical homework, it's not programming. Please don't suggest sites, they will then get an influx of these homework questions. I don't know that they're on-topic anywhere in SE network, and I don't know that we want to provide any site for Coursera homework."
 
Ok
 
Coursera provided its own student forums for a decade; the Coursera course had over > 1 million enrolled students; now that DeepLearning.ai has just released an 2022 update of the Andrew Ng course, I expect a tsunami of offtopic non-programming homework questions.
 
Seems fair
 
2:06 AM
https://stackoverflow.com/questions/72843300/how-to-create-a-dictionary-value-for-each-given-key

Is there actually anything wrong with the question, aside from people thinking it's trivial? My usual approach of expecting OP to break the problem down into steps seems a bit unfair here, since there are multiple decompositions and you get a one-liner either way.
I would love to have a reference question for simple dict creation patterns, but that seems way too radical
I decided that this one is arguably unclear, and commented to ask about it. If the values don't actually matter (which they might not), then this is a duplicate of e.g. stackoverflow.com/questions/2241891/…
although actually, that canonical needs to be revisited. OP talked about None specifically as an "empty" value, which isn't really clear terminology. It could be that a set was desired in the first place (or would have been? Did we have those by 2010?); and I just finished adding information from the comments about what happens if other values are used.
speaking of reference questions, here's a solid example of what I'd like to see more of: stackoverflow.com/questions/34835951/…
 
3:09 AM
I'd like to try to come to a consensus about the "forward declaration" canonical.
Existing candidates are:
https://stackoverflow.com/questions/1590608
https://stackoverflow.com/questions/3754240
https://stackoverflow.com/questions/758188
(it's late here, so I think I'll postpone working on a JSONDecodeError canonical as I was discussing in the meta room)
I had started hammering the forward declaration questions because I have a lot of browser tabs open and wasn't paying attention; then I realized that I hadn't actually made up my mind about which one I like best (although I did try to improve the first one a bit)
I'm also still on the hunt for a serious competitor to stackoverflow.com/questions/19326004 - something that centers the idea of using return values, but also explains globals, function attributes (since apparently that's something that people would actually think of trying) and attributes of self (curiously missing from the discussion)
keeping in mind that the underlying misconception is the belief that a function would "return a variable" rather than a value
 
3:39 AM
stackoverflow.com/questions/14804084 is another "forward declaration" question, but for classes rather than functions. Is that worth keeping separately?
It seems to have been used to close some questions that were about functions.
It may actually be the superior approach, though. This way places emphasis on the exception, and on the idea that scripts run in order, which is useful for beginners
(see also e.g. stackoverflow.com/questions/50237122 which was in the linked section, but not actually duplicate marked)
 
4:06 AM
stackoverflow.com/questions/12412324/… What on earth is this complete mess of a question??
 
4:25 AM
Considering stackoverflow.com/questions/803616 and stackoverflow.com/questions/6289646, is one a duplicate of the other?
 
4:44 AM
I provisionally chose stackoverflow.com/questions/3431676 as a canonical, but stackoverflow.com/questions/452610 seems to have some advantages. Might be a merge candidate.
(stackoverflow.com/questions/2295290 is much more popular/"frequent" than either, but I think it's too technical for most people who have the question.)
 
 
1 hour later…
6:29 AM
@AndrasDeak--СлаваУкраїні it was more for the 80s vibe in the video :) One of the birthplaces of goth
 
(Actually, I do like the frequent one if the question is edited and modernized a bit. )
stackoverflow.com/questions/49328869 I don't think this duplicate closure is appropriate, but it does seem like we need a generally clearer set of canonicals to cover the topic of Python names and name binding. (i.e., the material from Ned Batchelder's famous talk nedbatchelder.com/text/names1.html)
 
 
2 hours later…
9:20 AM
I'm having some amnesia issues, I guess. Re-found stackoverflow.com/questions/16043797, which I am now confident will be the canonical for the return-from-function issue. I'll do more cleanup and add more answers or something. stackoverflow.com/questions/19326004 is totally unsuitable due to the dominating answers about function attributes.
I also have insomnia issues, apparently.
 
9:31 AM
@roganjosh I found the culprit, Python on Windows need a lot more environment variables in order to start correctly, e.g. github.com/mozilla/glean/pull/1908/commits/…
good lord that one was a wild goose hunt
 
9:43 AM
5
Q: Fatal Python error: failed to get random numbers to initialize Python

Sunder GanesanFatal Python error: failed to get random numbers to initialize Python Environment windows 10, VSC 15 Using CreateProcessA winapi and passing lpenvironment variable to run python with scripts. when lpenvironment is passed null, it works fine. If I set environment variable PATH and PYTHONPATH = "...

turns out that's already been asked, but the question for some reason did not have the full string
i.e. Fatal Python error: _Py_HashRandomization_Init: failed to get random numbers to initialize Python
 
Because it had gibberish in the middle, better get rid of it
Unless the message was changed over time
 
who knows, but this frustrated me enough that I am going to post a new answer with an example to include the keyword so the searches will bring this up
 
Guys could you check this edit Ive made real quick ? stackoverflow.com/suggested-edits/5389318
needs to be closed as duplicate
 
10:07 AM
@metatoaster you could also edit the question
@l-_-l then why edit it?
 
I am not sure if the truncated version shows up anywhere, but I gave an answer anyway with code example on how this can trivially be triggered
 
@AndrasDeak--СлаваУкраїні need to edit it then close it since title is irrelevant
 
I might get around to edit the question when I can find some additional effort
the most annoying bit about this issue is that I came across similar requirement for environment variables on Windows for starting Node.js processes from Python
 
Please don't spam by starring random messages
@l-_-l there's not much point spending effort on a question you know will be closed.
 
Fine
 
 
1 hour later…
11:41 AM
@l-_-l I've hammered the question since it was in dupe vote limbo. If you are sure about closure, you can also directly ask for help on closure instead of editing - many regulars have extra curation rights. (Fine print: don't overdo it, focus on Qs that need it, don't disturb the room mood, see the room rules, etc.)
 
Side note: if you really want to edit things that get closed, wait until they're closed and edit without ticking in the "this edit makes the question eligible for reopening" tickbox. That last part is important.
 
There's a checkbox for that now? Neat
 
yeah, fairly recent, one of the more meaningful additions from the company
(And the default is unticked!)
 
12:04 PM
Impressive
 
 
5 hours later…
4:41 PM
I think stackoverflow.com/questions/3099987 is a slightly better canonical duplicate than stackoverflow.com/questions/942543, but I wanted to ask for second opinions. They're quite similar on statistics, but the second one inadvertently asks slightly more broadly (since it mentions wanting the value-pairs to call a function, which introduces the separate topic of using *args). Is merging possible?
I think a fair amount of work is still needed either way, especially to make a searchable title
@AndrasDeak--СлаваУкраїні FWIW, I've been doing a fair bit of this sort of thing, to improve signposts for duplicates
 
@KarlKnechtel sure, but you have a hammer
Plus the experience to judge edits. Plus the rep not to have your edits reviewed.
 
true
in the specific case that was discussed above, I would reject that edit anyway, or rather, not make it myself. Signposts should retain titles that capture alternate ways of describing the problem, because the entire point is to direct beginners who think with inscrutable beginner logic to the canonical
more nicely stated, actually phrases like "password field" are a perfectly reasonable way to conceive of the desired effect.
I did edit because there was a grammatical error, and to try to describe OP's version of the problem more clearly. I can see the possibility that it actually doesn't resolve the problem for OP, because the canonical doesn't mention anything about the Textbox class and it might not be clear how to integrate the echo-off logic.
 
 
2 hours later…
6:53 PM
@metatoaster interesting find. Definitely wasn't aware of that one!
Just doing some more poking around in alphafold. It never ceases to amaze me that Google just did away with standard Python packaging and 4 space indentation. I just don't get it
 
7:10 PM
Please note my comments on stackoverflow.com/questions/1261875/python-nonlocal-statement and stackoverflow.com/questions/8447947/…. I suspect that many questions have been dupe-hammered with the first, but would be better linked to the second. A few might have the opposite problem, too. Both appear to be clear canonicals for their respective niches.
Also: I started a GitHub repository for workshopping some missing Python canonicals: github.com/zahlman/so-workshop
 
@roganjosh looks super weird. but it's also mixed in some places, which makes it even weirder. What do you mean with not following packaging standards though? as far as I can tell the just use setuptools, right?
 
7:42 PM
@Arne Mainly in terms of the test files just haphazardly thrown in through the main repo
They do the same with tensorflow too so it looks like it's policy
 
ah, right. bundling them with the source code.. ugh. and they don't remove them when building the package either =(
 
Yeah, I just don't know what they gain by seemingly making it their policy. I can kinda understand the indentation if they need massively-nested stuff but everyone else seems to be getting on ok with PEP8
 
partly because it's very very bad if your code is "massively nested"
 
Yeah, exactly. But on the other hand, I don't think anyone would argue that Google doesn't have a team of some of the most talented programmers on the planet. It's a weird juxtaposition for me
 
it's still this mind-bogglingly huge megacorporation, which, I must assume, is horribly inertial
The first guy hired to do Python hated Python, now they are stuck with this setup. Something like that.
 
7:55 PM
That's quite possible
 
8:14 PM
Hello
 
Thank you
I am writing a CSV file and would like to skip writing a row if it's the same as as the previous i.e. avoid duplicates.
What's the best way to do this? I considered saving the previous line and comparing it to the next but comparing lists is nontrivial.
 
How are you writing that CSV file?
@northerner comparing lists is trivial
 
Comparing lists is nontrivial? How?
 
just store the previous row and check if row == current: and continue
 
8:16 PM
With .writerow([...])
@AndrasDeak--СлаваУкраїні can lists be compared like that?
 
@northerner so you mean "with csv.writer"
 
yes
 
@northerner otherwise it would be a bad joke from me to tell you to do that
Just open up a Python REPL and play around with some small lists.
Have you read a good Python tutorial yet? I would imagine this is covered.
 
I thought we like bad jokes in this room? :(
 
"Like" is a bit of a stretch, most people only tolerate me at best
 
8:23 PM
I wasn't looking carefully enough at the output ;)
How can I check if two lines are equal, without considering 1 of the columns?
 
Either build two new lists that don't include the given column, or loop over the lists along with an index (use enumerate) and skip the column you want to ignore.
latter is probably cleaner and more extensible
 
9:17 PM
hello, im trying to use a module (msprime) but it gives me an error when i try to import it.. can anyone help?
 
@NickVen hi, we can try, just ask
 
the error is "import error"
even though i have installed it with pip install
 
To be on the safe side, use python_you_are_using -m pip install instead of pip install, this ensures you're using the pip corresponding to your python executable.
If you have more than one Python installation on your system then it can easily happen that the pip command corresponds to a different Python installation than what you are then using.
Alternatively, it's possible the install fails, so make sure you read what pip tells you when you try to install.
 
thanks i'll try that
@AndrasDeak--СлаваУкраїні it says "requirement already satisfied" and when i import it it gives the same error
im using jupiter
 
then use python -m jupyter to use the same environment :P
not sure if that actually works though, depends on jupyter
Not sure if jupyter knows to use its own pip when you do !pip install in it. Might also be worth a shot.
If all of these tell you that the library is installed, then perhaps you are trying to install import it using the wrong name. Sometimes packages have a different name than how you have to install import them.
 
9:30 PM
ImportError Traceback (most recent call last)
<ipython-input-2-d683e264c251> in <module>
----> 1 import msprime

~/opt/anaconda3/lib/python3.8/site-packages/msprime/init.py in <module>
26 """
27
---> 28 from msprime._msprime import (
29 NODE_IS_CEN_EVENT,
30 NODE_IS_CA_EVENT,

ImportError: dlopen(/Users/maria/opt/anaconda3/lib/python3.8/site-packages/msprime/_msprime.cpython-38-darwin.so, 2): Library not loaded: @rpath/libgsl.25.dylib
Referenced from: /Users/maria/opt/anaconda3/lib/python3.8/site-packages/msprime/_msprime.cpython-38-darwin.so
@AndrasDeak--СлаваУкраїні any idea what this means?
 
It looks like the msprime package is installed but parts of it are missing.
 
how do i fix it?
 
you can edit/delete messages for 2 minutes in chat
 
oh sorry
 
thanks
@NickVen I would first try uninstalling then reinstalling it. If that doesn't help I'd look at their issue tracker to see if it's a known issue...
@NickVen actually, I misread. It looks more like the library is trying to use libgsl, and that is missing
I.e. a system dependency is missing for the package to work.
 
9:35 PM
@AndrasDeak--СлаваУкраїні so i should use pip install libgsl?
 
No, I'm pretty sure you need your mac's package manager for this. Hold on, I'm looking for related issues.
 
thank you very much
 
ah, you're using anaconda
Did you first try installing msprime via anaconda's own package manager? It should be aware of system dependencies and install them too.
 
@AndrasDeak--СлаваУкраїні how do i install it through anaconda? (i'm a rookie)
 
Have you come across the concept of a "conda env", did you by any chance create and activate one?
I'm not actually sure what the relationship is between conda-anaconda-miniconda, so I'm uncertain here myself
 
9:42 PM
i have entered these in the terminal: "conda install -c conda-forge msprime
conda install -c conda-forge/label/cf202003 msprime
conda install -c conda-forge/label/gcc7 msprime"
 
Just to be clear, did you do that now, or before you came asking here with your import issue?
 
before
 
That seems like three attempts at installing the same msprime package, correct?
 
yes
 
Why did you try the latter two after the first one?
 
9:43 PM
dont know :(
 
OK. I don't know how much you borked your conda env, assuming you have one activated. My recommendation would be to start from scratch with a new conda env. Msprime has a helpful "full example" for installation with conda, and it starts by creating a dedicated conda env: tskit.dev/msprime/docs/latest/installation.html#full-example
You would have to conda install jupyter and whatever else you need into the same env to use them together. And activate this conda env before using it.
> Warning

If you installed Python using anaconda/miniconda, please install msprime using conda. Link/load time errors will occur if you mix a conda installed Python with system libraries.
that is exactly what you were seeing ^
 
ok i'll try this
 
OK. Do take your time. Reading a conda primer might help too. There's not much to it but you should understand the basic concepts of having an env activated and using conda install vs pip.
 
9:59 PM
@AndrasDeak--СлаваУкраїні now msprime works when i open python in the terminal but not on jupiter
 
Did you install jupyter in the same conda env, and run it from there?
 
with conda install jupiter?
 
precisely
16 mins ago, by Andras Deak -- Слава Україні
You would have to conda install jupyter and whatever else you need into the same env to use them together. And activate this conda env before using it.
 
it gives a syntax error
 
I'll need more information than that, although I have a good guess.
 
10:05 PM
i typed "conda install jupyter"
 
in the terminal
 
Can you copy the error message then?
 
oh i had to do it before i open python?
 
Did you notice how you did conda install [...] msprime earlier? Yeah, same thing here. Wherever you put conda install msprime, put conda install jupyter in the same place.
 
10:14 PM
it says this : Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
 
So where's the output with the versions?
 
thats all it says :(
 
after that i typed conda install msprime
 
I thought you already had msprime installed in that env.
 
10:16 PM
i did it again to be sure
 

« first day (4278 days earlier)      last day (653 days later) »