« first day (3449 days earlier)      last day (1482 days later) » 
00:00 - 18:0018:00 - 00:00

6:36 PM
@MisterMiyagi I looked for over an hour, and waded through a sea of junk, and what I cited was the best I found on SO; we keep getting low-grade duplicate/new-user questions, like Trying to understand Random forest for regression. There's more stuff on CV, and presumably on DataScience.SE etc. If you feel there isn't a good enough dupe target here on SO, you can pick another close reason.
@PaulMcG There's clearly some consensus towards starring humorous stuff. But that isn't what AD claimed "We prefer if only interesting things are starred, that can possibly be relevant to a broader audience.". The internal bantering of the Python room, amusing as it may be, isn't "relevant to a broader audience." That's all. I doubt anyone can come up with guidelines either. Currently there are no guidelines.
 
I don't know how I've survived this long without guidelines telling me what to do every minute of my life
 
Alternate take: It's surprising I've survived this long doing the precise opposite of what guidelines tell me to do on a regular basis.
 
@toonarmycaptain I have an image of you now going outside, running towards total strangers and giving them a hug and french style kiss on each cheek now :p
 
6:51 PM
@JonClements Did you meet me back in uni? ;)
 
@JonClements Who? :P Don't hold your breath, sir...
 
@toonarmycaptain I don't believe so - sounds like I'd have remembered that :p
 
@JonClements Theater/Art double major was an interesting couple of years.
 
@JonClements but anyway we can dream of how we'll celebrate when lockdown/quarantine ends
 
"interesting" certainly sounds like one way to describe it :)
@smci crowding out restaurants and pubs if any still exist probably :)
 
6:57 PM
@JonClements I'll play football with my friends and have a beer. Euro 2020 Championships postponed a year, as well as Olympics... and I don't know what was finally decided for this year's Champions League finals.
 
If anyone is interested in a virtual hackathon tomorrow and Saturday: datavant.com/pandemic-response-hackathon Just passing it along.
 
@PaulMcG if it was a cheerier subject - maybe :)
 
@toonarmycaptain For free cocktail recipe class from a master mixer, see this weekend's Instagram Live at @discoverpuertorico at 19:00 ET on Saturday and Sunday. How to make a piña colada. Also master salsa classes. (Puerto Rico tourism is dying a death due to the virus, this is their virtual response.)
And the "Italian mayors on Facebook" video compilation is good for blowing off steam.
 
Looks like there are a bunch of these open source "we want to help your COVID research" sites - found 2 in 2 minutes. To minimize the COVID chat on this room, I created a new room for this topic. chat.stackoverflow.com/rooms/210400/python-covid-help
 
@PaulMcG Good stuff. Suggest that be language-agnostic, a lot of the bio people use R.
 
7:13 PM
@PaulMcG neat, thanks
 
@PaulMcG: I mentioned that to the main R room 'GMTs'. Presume you know Kaggle started doing a lot of this too.
 
Cheers (pun intended).
Quarantini: 5 jiggers of gin while looking at a bottle of handsantiser, then drunk while looking wistfully out a window. (yes, that's a `M*A*S*H` reference)
 
@smci I'll admit, I was looking at our work Slack channels thinking "Once this is over, we'll have a good office reunion party." But that's just what the virus *wants* us to do
 
AMC
@PaulMcG But that's just what the virus *wants* us to do BE CAREFUL IT'S WATCHING YOU D:
 
MongoDB is opening up their annual conference for virtual attendance for free: mongodb.com/world
 
7:28 PM
 
7:41 PM
debugging help/ too reliant on details stackoverflow.com/questions/60870815/…
 
you mean no MCVE, right?
 
@AndrasDeak All of it. Almost every close reason a question could possibly have. (I can't even see wy OP needs to wrap read() and write(), but whatevs)
 
I will name all my parameters "data" from now on. I won't be wrong.
 
8:02 PM
Hey, imagine a perverse sort of close-question-golf: design a question which fulfils the maximum possible different close-reasons...
 
Guys did any of you encounter this error when using io.StringIO? Python3 error: initial_value must be str or None, with StringIO? The workaround pd.read_csv(BytesIO(dat.encode('utf8')), ... seems annoying. What to do?
 
Hmm? Is the problem just that the input to StringIO is bytes where it should be str?
 
@AndrasDeak Well I worked around with pd.read_csv(StringIO(dat), ... encoding='utf8')
 
from io import StringIO as io_
import pandas as pd

pd.read_csv(io_("""\
A B
1 2
3 4
"""))

#    A B
# 0  1 2
# 1  3 4
works fine for me. I'm inclined to agree with AD
 
@smci OK, so that sounds like a "yes". Then this is not "annoying", this is just that bytes is not str, and unless the bytes contains ascii you really can't guess what the encoding is.
And the "workaround" is the solution: you have to know and use the encoding corresponding to the bytes. In case of OP's problem you linked, requests can guess that encoding usually.
 
8:34 PM
@AndrasDeak The bytes I gave it did only contain ASCII, but it errored anyway. That is annoying.
 
@smci but it can't know that
This is a very fundamental concept that underlies the python 2 vs 3 switch
 
it will refuse to guess on your part, though you can always use something that guesses the encoding if you want it to. This was the big reason why python 3 broke compatibility with python 2.
 
Python doesn't guess the encoding on bytes objects (because it can't, period). Even with ascii someone could create a weird encoding that doesn't reproduce ascii on the lower code points. And then it would blow up...
Much much easier to refuse to guess altogether.
 
Personally, im glad for this switch, because it taught me about bytes/strings and all that jazz, and it forced me to get it down and actually learn it till i understood what i was doing.
(ofcourse, no one should take that to imply that i actually know what im doing. that only happens on a half moon every tuesday, unless there's a solar eclipse out)
 
how can I define a function that takes a variable number of arguments but no more than 5?
 
8:38 PM
@piRSquared you have to check the length of *args yourself, unless you want 5 fixed positional named args
 
simplest sounds like just an if check
 
Thanks all. Hmm, I thought I had a reproducible counterexample a few minutes ago, but can't reproduce.
 
sounds easy enough
 
Am I losing it or is the behavior with read on io.StringIO less than 100% deterministic? (I take all your points about not being able to infer encoding)
 
It shouldn't be, it should be as good as a file. Do you have an example?
 
8:41 PM
Hm, i don't have any reason to suspect why it shouldn't be deterministic
 
@AndrasDeak You're not going to believe me, but I had an example that seemed to tickle it, but when I rerun the same line it won't now.
 
well, Heisenbugs are a thing ;)
Perhaps you read from an older StringIO twice? So you had nontrivial state.
 
perhaps it was just a glitch in the matrix. perhaps they changed something.
 
@ParitoshSingh I recently learned the term 'purplepilled'
 
ooh, and looks like i've learnt it now as well
 
9:08 PM
@ParitoshSingh was it the same cat!?
 
@PaulMcG well, through that, I'm now being put in touch with medics in Germany to build a system for dispatching medics. That's everything else dropped from my schedule for a few weeks!
 
@JonClements might have been... Im not sure!
 
bloomin' Garfield... always after his lasagne...
 
9:39 PM
Ok, I've potentially taken on a huge project. I replied to a call for COVID-19 help here and one of the mods replied very quickly. I got redirected to an unanswered task. This is something I could really use help with if anyone has time, but I might ask some obscure/disparate questions while I try to help this cause.
 
@roganjosh Nice, kudos
 
Thanks. I don't know what this will entail yet but I'm crapping myself a bit. I would have preferred to assist rather than be the only appropriate respondent but... needs must
 
@roganjosh Well done on stepping up! Let me know if they need a parser or something.
 
they can just flash the parselight on the cloudy sky :)
 
you got this roganjosh! I'd love to be your bouncing board for ideas if you need one
 
9:50 PM
@PaulMcG I'm sure I can draw on your experience outside of just parsing. I need to get some idea of what the requirements will be and I guess I'm gonna have to be gunning for an end result, so even just mopping up bad code would be helpful
@ParitoshSingh thanks mate :)
 
in the unikely event of you needing numpy help feel free to ping me
 
@AndrasDeak Thanks. It didn't need to be said - I'd just pester you anyway :P
 
AMC
@roganjosh Nice to see people helping out!
 
oh noes :P
 
10:12 PM
want a little correction in python code anyone can help ?
 
Depending on how big "little" gets...
 
@AbdulRehman If this is about your fresh question on main then please don't ask
 
wim
10:58 PM
what is even the point of implicit string concatenation
it's only use seems to be causing this hard-to-find bug when you accidentally forget a trailing comma
>>> strs = [
...     "foo"
...     "bar",
...     "baz"
... ]
>>> strs
['foobar', 'baz']
zen of python #2 says this should require a + for concat
 
maybe something in here can help
knee jerk reaction though, i'd agree with you. need to go through that link myself
maybe i'll be convinced otherwise by the end of it. maybe not. who knows.
 
I made use of it the other day but yeah, it does tend to be more of a gotcha than anything else
 
Maybe the only good use case is trying to write well aligned multi line text blocks in indented blocks where you don't want the white space from the left that would be introduced by using triple quoted strings? shrug
 
you could append +
 
aye, explicitly writing + would just make sense to me too.
 
wim
11:12 PM
just read it through. not convinced.
 
same.
 
wim
the only decent rationale for keeping it was the gettext one, but even that was only half-convincing
 
> This PEP is rejected. There wasn't enough support in favor, the feature to be removed isn't all that harmful, and there are some use cases that would become harder.
Did the PEP actually explain those "some use cases"?
perhaps they feared that acceptance would put off users from python 3 :'D
 
wim
11:31 PM
hah, gets even the best of us! lwn.net/Articles/551438
 
Another vestige from the C legacy (like '%' string formatting)
 
@PaulMcG interestingly the PEP hinted at another one trying to remove % formatting
 
wim
I may be in the minority but I've got nothing against % formatting
"foo %s" % "bar"
"foo {}".format("bar")
1 is actually shorter and more readable, no?
 
It's harder to find where the fields are
I find it easier to place the fields in a format string
 
also format is more of a clue as to what's supposed to be going on rather than "what is the meaning of a modulus of a string!!!!?"
 
wim
11:38 PM
you never used C before python?
maybe I was biased because of familiarity with printf
 
Used C a lot before Python... but C didn't re-use the modulus operator for strings - at least stuff was named printf/sprintf etc and then you provided varargs...
 
wim
ah right
 
nothing wrong with percent formatting in the format string itself :)
 
wim
I guess using modulus was just "cute" because the field is also indicated with %
 
that's my guess as well
 
wim
11:41 PM
pathlib uses / for "cute" factor too
 
at least that reads as a path, I'm much more OK with that
much closer to string interpolation in my head
 
I think that works better... since the object on the left isn't a string literal and / is recognisable as a path separator
 
wim
the object on the left can be a string literal
I'm pretty sure "." / Path() will get strongarmed by __rtruediv__ or whatever the heck is the reflected magic
 
ummm... never tried... good point though
yeah... that does work
 
wim
did you see that left shift << got proposed for dict.update ?
 
11:46 PM
p = Path('/home/jon')
print('test.txt' / p)
# /home/jon
print(p / 'test.txt')
#/home/jon/test.txt
 
@wim at least it was snarkily rejected
 
wim
heh, yeah there was a snark from gvr somewhere too
> Of course, it's definitely possible to overdo this -- then you get Perl.
 
I meant the dict | PEP that said something like "overloading << to denote flow of information got real old soon after C++ did it"
 
wim
ahh, don't you love seeing a +1 in your reputation tab
when dv the accepted answer actually changed OP's mind (10k+)
 
00:00 - 18:0018:00 - 00:00

« first day (3449 days earlier)      last day (1482 days later) »