Ahahah, Andras, I just realised - my problem was I couldn't use .isin because it was throwing a KeyError, right? Because the thing I was checking against wasn't a keyed column, but an index. Eh, yeah, you just do df.index.isin. Derpderpderp.
(Also, this is your fault, Fizz, you started me down this path of Pandas and Machine Learning ;) ) ('fault')
I'm a consultant as well. This mostly entails charging 4x as much as I'd get paid on salary for the same job, and getting to tell senior people they're idiots without (as much) fear of career repercussion.
I only consult on Business Case stuff, so mostly telling people the blindingly obvious for exorbitant day rates (the talking bit of Poke's description). It's pretty dreamy in terms of actual work (well, effort/reward ratio anyway), I want to get more across to the development world and do more technical consulting.
Also, if you can do stuff in Python, doing simple stuff in Android is fairly straightforward, I've found the transition fairly simple, and I don't have that much experience in python.
^^^ Also that. We used Cordova Phonegap for a while and it just wasn't quite right running the app on the phone, unexpected behaviour, and honestly quite a lot of hassle for what we got.
One of the best things about this place is I get to have an opinion regardless of how qualified or not I am on a thing. It's like being in the Government.
I think, you can write your cool and clever solutions to famous problems in documentation instead of your blog. But not copy-paste docs.python.org like it is now
Though I guess Erlang's main advantage is OTP or whatever it's called
@Ffisegydd yeah it's like XML vs JSON - a lot of the time you don't need lots of formal structure, but sometimes only full namespacing and WS-Security will do
Resisting the urge to do a plagiarism check across SOD. I think if one "programs" by copying examples from the internet, one's appreciation of plagiarism might be ... erm ... limited.
Just managed to gently advise someone to remove their lovingly copied version of an entire library API from SOD :p
Problem is plagiarism can be a little hard to detect if you're not familiar with the exact library in question. Although, unfortunately, I am well practiced :(
@Ffisegydd Surely that would get you perma-banned ;)
These undesirables, interfering with the One Great Project.
I have a nagging suspicion that my protest in form of ignoring high-traffic tags in docs will be left unnoticed and it will not actually make a difference sigh
Buh - using that new format - offices.loc[offices[‘Employee’].isin(munged_output.index), keylist] = munged_output[keylist] - it replaces all the columns in the offices dataframe with Nan - is that because they have different indexes? If I show munged_ouput[keylist] it shows me the data I want - the two frames have headers with overlapping names.
For Legal Reasons(tm) I must point out that any and all ideas, theories, hypotheses, discussions, or gifs relating to Documentation or Stack Exchange as a whole should be considered jokes and should be considered the opinion of the individual author. For further information please contact our Corporate Advisor, Tristan StreamFace.
@Withnail Yes probably.
It's trying to lookup values to put there but cannot find any (due to the indexes being different)
Huh, ok. I can get it to transfer properly if I reset the indices on both before I run that command, but that feels really clunky and like a hack. Any recommended reading on this?
Just recieved an email telling me I am "a key note speaker at Animal Behaviour 2016 conference". There's a little bit of me that's tempted to go and talk about some random software project for 45 minutes.
@Withnail Oh yes, I am happy now. Python when twisted behaves differently, however the behaviour is best in BeutifulSoup. I definitely recommend letting python loose on Puppy.
My question above about the way I've hacked that Pandas dataframe back together - I think I want to ask it as a question. As it works, even if it might be an anti-pattern, is it better posited on CodeReview than the main SO site?
I'd tend to say yes, but I've found CodeReview an awkward place to fit into.
@Withnail One thought, BTW - can you reindex office to use Employee as the index? As it looks like munged_output is indexed on Employee. If so - then maybe your indices will match.
yeah, that looks likely. I'm going to make sure this one works, and then I'll try that as a refactor.
oh, interesting. Yeah, ok, that sort of works - except there's a date column (which I made the index originally so I could slice by date), which I lose if I use that method - so I suspect probably using offices.transpose('Employee','Date') is the way to do that effectively - don't think i've used the right syntax there but you get the idea.
There's a fresh SO question asking about cosine similarity of a N*N matrix. I assume that the OP wants the dot product of each pair of rows in the matrix. Is that correct?
@AndrasDeak If that were C, I'd say it sounds like a pointer bug. But IIRC Fortran doesn't have pointers... although I literally haven't touched Fortran in decades.
i'm perpetually amazed that stuff is still built in Fortran and the like, and then I remember that most of the government systems that deal with money in the UK are built in COBOL85 and there's only about 10 people can program them now.
I don't think I've ever done that, but I must confess that I was rather liberal with my upvotes on answers when I was going for the Sportsmanship badge. :)
Reindex: what Santa uses to keep track of his reindeer. :)
@JRichardSnape Did you get those links I left for you re: Sant Andreu Jazz Band? I didn't realise you were on holidays at the time, so you might have missed them.
@JRichardSnape Fair enough. Sant Andreu Jazz Band are a kids' school band from Barcelona. Their teacher / arranger often plays bass or sax with them, and they often have an adult professional sitting in with them. Give me a sec and I'll find those links...
@JRichardSnape: Check this out! Here's a rather impressive rendition of Billy Strayhorn's Lush Life from the amazing kids of the Sant Andreu Jazz Band, this time featuring Elia Bastida on violin. She's a tiny bit flat in a few spots at the start, but I think we can forgive her for that.
Here's some big band bebop from the incredible kids of the Sant Andreu Jazz Band: Hi-Fly by Randy Weston featuring Magalí Datzira on vocals and bass. The tone of her voice isn't great, but she certainly has great jazz feel.
Here's a small group of Sant Andreu girls. The Carla Motis trio: Elia Bastida on vocals & violin, Andrea Motis on vocals, and Andrea's little sister Carla on vocals & banjo. With help from their teacher Joan Chamorro on bass. Andrea also plays trumpet & sax. Bei Mir Bist du Schon
Some more from Andrea & Carla. This time with with Carla playing some nice guitar, and Andrea taking the vocals & doing a pretty average trumpet solo; I've definitely heard Andrea play much better, but it's still ok. On The Sentimental Side
I'm getting the feeling that the OP of reading a text file into a single string will object to the dupe target, saying "that doesn't tell me how to load it into a triple quoted string!"
ofc there's no such thing as a "triple quoted string"* but that's map-territory confusion for ya.
(*there is a triple quoted string literal, but that's something else entirely)
yes I have checked that post and its not what I want, the post was talking about how to read it as lines in a list, I want to read the whole text file as its in 1 string between 3 quotation marks — tarek abo elwafa1 min ago
@vaultah tail -f, or tailf, but the latter might be better
look at man tailf
> tailf will print out the last 10 lines of a file and then wait for the file to grow. It is similar to tail -f but does not access the file when it is not growing.
@AndrasDeak 10% trolling, 90% giving the simplest possible solution to what might be his problem in an attempt to get a response like "that won't work because [insert OP's actual problem here]"
Maybe his real problem is "is it possible to change the output of print(repr(my_string)) so it resembles a triple-quoted multiline string instead of a single-quoted string with escaped newlines?"
@JRichardSnape Good point. The sound quality of the Sant Andreu clips is generally pretty good, compared to a lot of YouTube clips, IMHO, but as you know, getting the mix right from a large ensemble is difficult at the best of times, especially when there's wind instruments involved.
So in gerrit we use WIP to indicate something is a work in progress so it doesn't get merged....every time I see it I keep thinking of the song "whip it". </useless_info_on_a_wednesday>
Basically I'm trying to take in commands as if I am pressing the keyboard. For example I open a notepad file. Once it opens I want to press 'a' 5 times and then press 'Tab' and then press 'b' five times. All within a python environment. — hrocsays14 hours ago
@WayneWerner Gerrit doesn't work with PRs exactly. It has voting. So if you agree with the code review you give it a +2, and if you agree with the "work flow" you give it a +1 which will then start the merge.
It helps other developers skip over reviews if they see a WIP in the heading
so they don't waste time reviewing something that is not ready
also assigning a -1 to the work flow yourself helps really ensure no one goes ahead and does a "oops" merge
@PM2Ring ha! nice.
@WayneWerner And the answer is a winner "It's not so clear what you're asking,"....
In an hour I'm interviewing an intern candidate and grilling him about Python. Any good question suggestions? We're having a general Python discussion first, then doing some coding problems, and then going over some of his code on github.
I mean I create a script that opens notepad. Once notepad is opened I want to type words into the notepad file within a python environment. I don't to type in the notepad program because it defeats the purpose of python scripting. — hrocsays14 hours ago
@DSM Ask him how to open a notepad file in Python and press 'a' 5 times and then press 'Tab' and then press 'b' five times all within a python environment ;)
I occasionally write input automation scripts myself, so it's strange to me when people get hostile about questions asking for the same thing. (It's understandable in this case because the initial question was so vague; I'm just talking about in general)