« first day (2949 days earlier)      last day (1983 days later) » 

9:38 AM
cbg
 
cbg
 
9:50 AM
@jpp thanks again, I've been thinking about your suggestion but I have doubts that it's necessary. Have you really seen instances where newbies didn't know if/how they could create ndarrays?
 
cbg
 
cbg
 
jpp
10:07 AM
@AndrasDeak, Yep, I am an instance :). For a long time I had no idea with np.ndarray meant.. because it's not often referenced (apart from in the docs). I'm also aware there are lot of non-programmers who use Pandas / NumPy without knowing what a class is. We may think that's sad, but it's the truth :S
Also, fyi there's a decent canonical on np.array vs np.ndarray: stackoverflow.com/questions/15879315/…
 
Huh, didn't expect that. Thanks.
Though I'll still have to think whether such a remark would fit there
 
jpp
@AndrasDeak, No problems, was just a suggestion. Your answer is good as it stands.
 
thanks :)
 
10:57 AM
cbg
 
visual representation of pytest.xfail imgur.com/gallery/nNpX9L7
 
11:16 AM
@AndrasDeak lol
aka, I blew an audible gush of air out of my nose
 
 
2 hours later…
1:21 PM
hey, guys do anyone have a tutorial on '' how we can do face recognition from live cam''
 
I was going to write that tutorial up after by blog post about DIY Cold Fusion
 
seriously...?
 
No... I was being ridiculous
I would imagine that task is pretty difficult.
So I'd venture to guess that a tutorial on the subject would not be readily available
 
1:37 PM
there's probably a phd thesis out there that describes it ;)
 
ooh... are you sure there isn't any tutorial on it
 
@AndrasDeak hehe
 
@AkhilAlexander it's not impossible, but it is a complex task. Fetching a stream of images, doing classification (which needs a training process beforehand), things like that. Separate parts are surely available as tutorials. But it's not even clear what libraries you'd want to use, and any tutorial would depend on the library.
Unless you're in luck and someone wrote a blog post somewhere about this exact subject. But this is both complex and specific so odds are we'd have to google as much as you do.
 
@AndrasDeak is it possible to train realtime images
 
1:43 PM
I don't know (I doubt it) but why would you want to do that?
 
that's my next task
 
Are you familiar with machine learning in general?
 
yes I have been working in the field for 8 months..
 
So how would training realtime images work? Isn't the point that you have a collection of faces you want to recognize?
 
1:59 PM
yes from video streaming I want to train real-time images
 
OK, I don't think we're going anywhere
 
2:22 PM
\o cbg
 
2:41 PM
.
 
@AkhilAlexander Like Andras said it's a complex subject and you will have to break it down into pieces, then maybe you can find tutorials for each of those pieces. Either start with getting Python to read a video feed from a camera. Or by doing face recognition on a video file.
Also, you need to define the exact inputs and outputs. The input is real-time video, but what do you want as output exactly? To recognize the person (like, the particular individual) in front of the camera? To recognize whether or not there is a face in there? To track the position of the face?... Depending on that, and your skills/data/resources/etc you will find different techniques you may apply.
Other questions (to consider down the line after you get something working) could be whether you want it to work in different light conditions, with different cameras, from different distances, from different head positions (profile, upside-down, etc.)
 
hello does anyone here use spacy?
 
3:11 PM
actually, don't use that dupe target because I want to delete that target
there are three targets on the target courtesy of wim
 
jpp
how do you know whether a question is a HNQ?
that one seems to have accrued ~15 upvotes in 5 mins across question & anaswers.
 
just rep farmerer answerers pushing each other up the ladder
hot questions are here stackexchange.com
 
jpp
I'd like to think it's because there are a large number of users who are learning Python and can't appreciate more insightful answers.
But maybe I'm being generous.
 
and this is why SO should get rid of rep
 
rep is fundamental to SO, no SO without gamification
what we need is proper use of moderation tools
 
3:24 PM
^^
 
it's not needed at all, votes are enough
 
that blatant dupe is still at 1 close vote
 
@marxin How do you decide who votes? How do you decide privileges? How do you decide gold badgers?
 
the problem is users swarming to answer blatant duplicates (= generating garbage)
 
ok, then maybe rep should not be public
so people wouldn't farm it
 
3:26 PM
that I'd be okay with :D
 
jpp
I think the main problem is the need for instant gratification (that +25 when you answer a question) to encourage the base of answerers.
If there was an in-built delay of 1-day before any answer could be upvoted or accepted, it would give more opportunity for judicious voting / ppl genuinely finding the question helpful.
But that would also be asymmetric, since we need the ability to downvote incorrect answers.
 
or a penalty if the question gets closed :p
 
Or no rep for a dupe. All suggested and rejected/ignored on meta
 
jpp
SO Inc needs visitors, they don't care if it's for SO-led development via dup-asking.
The other issue is there aren't enough people curating canonicals.
 
3:43 PM
You don't need a canonical, just one of the dozen dupes
 
@AndrasDeak I support you, why not post on Meta to get traction? The dupe swarming is a real pain in the a**
 
It would be a dupe...
 
from the other hand, there isn't much harm to have dupes, they will get ordered by popularity by the search engine
so naturally the best Q/A will get promoted
 
@marxin it's often hard to wade through the garbage to find a proper solution to a problem. And if it were easy enough to find the good ones there wouldn't be so many new crap dupes
 
possibly you're right, personally as a "common" SO user I never came over this problem
or I didn't pay too much attention that might be the case
 
3:48 PM
@Aran-Fey has very bad experience in the subject
 
jpp
4:03 PM
Any thoughts on this dup closure. I kinda feel it's presumptuous to mark a post tagged python + regex with only regex targets.
Esp since Python string operations are typically more efficient than regex, even if less easily adaptable.
[have seen this done relatively often, in fact, by some keen regexers, which is why I'm asking]
 
@jpp assuming its not his homework :)
 
jpp
@marxin, Let's assume good intentions here.. Sometimes there are genuine questions on SO.
 
maybe he got told to solve it using regex
 
jpp
Sure, but in general a question doesn't preclude alternatives. And often if you bother asking OP says they are open to alternatives.
 
yeah I afree
agree
 
4:19 PM
in a library's test code, I'd like to replace a print and instead log an exception with logger.exception, but it's not showing up when the tests run (- print does though). Do test libraries usually avoid calling basicConfig or doing any other logging setup? here's the code: github.com/pypa/auditwheel/pull/113
I suppose I can do traceback.print_exc() but I'd rather use logging...
 
it depends on a test runner I think
I see that its pytest in your case so maybe its log_cli option that has to be set
 
4:36 PM
Thanks, I'll look at that.
 
hi guys, I'm having a problem running this script github.com/explosion/spacy/blob/master/examples/training/…
how do I enter the three parameters model, output, and iterations?
 
@erotavlas try tunning "python train_ner.py"
 
tunning?
 
oh, running
 
you probably have to pass those args as command line arguments
 
4:41 PM
this plac thing should just ask you for parameters
 
I dumped the entire script into my jupyter notebook
and I got this error
usage: ipykernel_launcher.py [-h] [-m en_core_web_lg] [-o None] [-n 100]
ipykernel_launcher.py: error: unrecognized arguments: -f C:\Users\ssalpietro\AppData\Roaming\jupyter\runtime\kernel-2c155fa5-95dc-4bc8-aa87-bb2706c49baa.json
so maybe if I save the script to my jupyter notebook folder then try and import then run it from there with parameters?
 
it should work
although you should be able to run it from command line as well
 
ok will try it, thanks
 
the one I've closed as I'm not that happy with
 
wim
3.5 type hint one might be better What are Type hints in Python 3.5
 
4:57 PM
@wim thanks - added that but it's a shame the -> is so far down scrolling wise...
 
@AndrasDeak Indeed. These days I spend my time grinding gear in a video game, and it's frankly much more fulfilling than struggling to find good duplicates on SO
 
heh
 
recbg
@jpp sadly you might be correct.
the harder it is to find the correct solution among the already asked QA, the more views the job ads will have.
 
sorry guys I'm still having trouble running that script
ok nevermind I just did python train_ner.py from the command line and it ran it
 
5:34 PM
Heh.... "Hypotenuse" is the long one - guess that's a fairly straight-forward way of describing it :)
 
6:00 PM
problem statement: test file had a VERBOSE=True global with lots of if VERBOSE: print(... - I don't think it ever changes to False but what was being printed (mostly commands, e.g. docker, prefixed by $) seemed better off behind a logger.info call. The maintainers want to see commands though. When I do --log-cli-level=INFO then it seems like a whole lot more gets printed... probably more than the maintainers will want. Possible solutions: back to conditional printing, level=25, ???
I'm leaning towards a TEST=25 global and calls to logger.log(TEST, ...)
 
to treat the number sign # as a string do I just surround it with double quotes?
example string
MR#: 00000000
 
exactly like every other character, it requires quotes to be a string, yes
 
ok got it thanks
except one problem, the string is inside json and I have something like this
' SEE BELOW Accession #: FS0'
however if I put quote around # it will still be treated like a comment (everything after the #)
 
Wait, what? You have JSON in your code?
 
6:20 PM
I found the problem, normally the # doesn't cause any problem since its inside quotes anyway
 
@AndrasDeak Everything is open to abuse. Some systems have more holes to exploit than others. For whatever reason Stack Overflow, Inc thinks the current configuration comes closer to an optimal solution than anything else presented thus far
 
but what happened was a particular string ad an embedded single quote like this
('Fname X Lname' MD',{'entities':[(0,13,'PERSON')]})
after Lname'
so it prematurely ends the string there and the rest of the strings is treated like python code including the # in the string which ends up as a comment indicator
so my next question is how do I deal with the single quote in my string?
I think triple quote around entire string?
('''Fname X Lname' MD''',{'entities':[(0,13,'PERSON')]})
uh gross now I found a string that has a double quote at the end of it and my triple quote becomes a quadruple quote messing things up again
 
without an MCVE this is just a pointless monologue, you're aware of this, right?
 
yeah
 
You can use backslashes to escape quotes
 
6:34 PM
all I have to say is python string handling sucks
 
have you considered the possibility that you're doing something wrong?
 
its not me its python
 
it always is
 
python literally has more ways to write string literals than most other languages
 
because python has that rule about doing things in one obvious way :P
 
6:35 PM
this
1
A: How to include a quote in a raw Python string?

charrold303Since I stumbled on this answer, and it greatly helped me, but I found a minor syntactic issue, I felt I should save others possible frustration. The triple quoted string works for this scenario as described, but note that if the " you want in the string occurs at the end of the string itself: s...

I'm encountering the quadruple quote scenario as indicated by the 5th answer
 
>>> """abc\""""
'abc"'
 
that means I have to detect when there is a quote at the end of my string and precede it with backslash before surrounding with triple quote...that's way too much work :)
 
Do you even have literals? From what you posted earlier I kept thinking that you read a string into memory in some way
 
@erotavlas huh... oh n/m, Kevin'd by @Andras :)
 
Welp, time for me to tune out of this conversation
 
6:39 PM
i'm just kidding...I will try the backslash idea, thanks :)
 
but anyway, I can only offer the world's smallest violin until we see an MCVE
 
my strings are their own mcve
 
Yeah, that doesn't mean anything. Good luck.
 
@Aran-Fey I at one time proposed "okra" as the Salad Language synonym for this
Not quite as negative as "garlic", just an expression of "I'm no longer interested in discussing further"
 
That's the first time I've heard of that plant
 
6:53 PM
I have a horrible feeling that slight "crunch" noise when I sat down was my head phones :(
 
yup... beep
beep beep beep beep
but still work though... so \o/
 
7:40 PM
are there any scrapy users here?
 
don't ask to ask :P
 
I just knew you were going to say that :)
 
wow, RIP Stan Lee
 
yup - 95 isn't a bad inning though
no more cameos :(
 
yeah, no reason to watch those movies anymore
they'll probably include some kind of tributes anyway
 
7:41 PM
I ask because I've ended up doing a lot of scraping stuff recently using scrapy, and while I quite like it, I've had to adjust it quite a bit, so quite a while back, I started developing my own
 
scrappy? :P
 
that might be an interesting live name :)
is .do a TLD :p ?
currently calling it "aragog" :)
 
is shelob too intimidating?
 
@JonClements I hear they pre-filmed a ton of cameos for this, but thematically it would make sense to stop doing them after Avengers 4
@AndrasDeak I haven't seen him in any roles as a villain, just as Monk and the father in The Marvelous Ms Maizel
 
@AndrasDeak excelsior...
 
7:47 PM
@KevinMGranger :|
 
@AaronHall first thing that pops into my head there is "NCC-1701B" :)
 
weird name for a patronus
 
 
1 hour later…
9:11 PM
So I'm using Flask api alongside a Vue frontend
And for whatever reason
Despite saving the username in the session
After a using is authenticated
the flask session is empty
it appears that nothing is saved between subsequent calls
Bear in mind this works fine with a requests.Session() object
But for some reason the browser doesn't work
 
Paz
10:07 PM
People i need help real real quick
I have a test tommorow and i really need to sleep so heres my problem
 
zoooom
 
Paz
on py 2.7
 
what time is it for you?
 
Paz
I built this list: lastnames = [i.split(" ")[1] for i in names]
12:10 am
 
ah
right, it's in your profile
 
Paz
10:08 PM
now, not every i list has more than 1 element in it
an an if statement in the list comprehension itself (if len(i) > 1) does not work
so I get an index out of range exception
 
what do you want to happen for a single-name item?
 
Paz
just skip it
 
the if doesn't work because len(i) is the length of the string
you want the number of words in it instead
if you don't mind splitting twice you can just drop if len(i.split())>1 in there
otherwise you can count the whitespace in i.strip() or something like that
 
Paz
so when i'm writing an if statement on the conditional part, the "i" i'm using would be the i after the expression?
*as the expression?
 
It's the same i as in i.split(" "). What else could it be?
 
Paz
10:12 PM
ohh never mind I got you
 
OK :)
 
Paz
thank you!
 
no problem, good luck tomorrow
 
Paz
thanks :)
good night fella
 
night
 
10:26 PM
@JonClements worked with it a bit for a project. Scrapped it in favour of spark afterwards, was too slow... or maybe that was me.
Scrapy does not support distributed crawling... but spark does, so ¯\_(ツ)_/¯
 
11:02 PM
I have to calculate a parameter, in a pandasDF, that's based on around 15 different conditions (mostly &). It's basically the 'status' of real time data. What should I be looking up?
 
logical operations on columns perhaps
or vectorized operations on columns in general
as in (df.col1 < 3) & (df.col2 > 4)
 
with np.where? Is there any other neater option?
 
np.logical_and.reduce
pass a list of masks and they will all be ANDed with each other
 
np.where is almost never the answer
 
Any other key words I can look up apart from the ones you guys have already given me?
 

« first day (2949 days earlier)      last day (1983 days later) »