« first day (1790 days earlier)      last day (1423 days later) » 

8:16 AM
@flawr you seen this? Dude does a triatholon (3.8km swim, 180km cycle, 42km run) in each of the Swiss cantons. I like the maps of mountain cantons such as Wallis, Graubünden and especially Uri and Glarus. You can see there are just three valleys to go up and down in :P
 
 
4 hours later…
12:00 PM
 
 
1 hour later…
1:23 PM
I'm having trouble converting my cartesian to spherical coordinates. Wikipedia has a nice conversion table, but the problem is that using atan() in MATLAB it can't discern between (-y)/x and y/(-x), nor y/x or (-y)/(-x), thus I end up with -90 to 90 degrees instead of the full 360 coverage.
My prof sent me phi = acos(x/sqrt(x^2+y^2)), but that maps to 0-180 degrees. I know I have all four quadrants present in my data set (x,y ; -x,y ; x,-y ; -x,-y), so I know I should get the full 360 degrees. How can I do this?
 
1:36 PM
@Adriaan definitely shows accute symptoms of a lack of chocolate and cheese
this guy is crazy:)
@Adriaan atan2
atan2(y, x) gives ou the full 360°
apart from conv() and the magic wand it is the most useful function ever
 
@flawr Merci Vielmals!
 
and at that point you might also want to look into unwrap() if you intend to plot the angles you get, and not only do calculations!
@Adriaan Bitte gärngsche:)
 
And now I do phi(phi<0) = 360-phi(phi<0) to get (0 360], innit?
@flawr I bet that'd be gärnxeh in Züri
 
actually no, "xeh/gse" comes from "gesehen", but "gsche" means "geschehen"
@Adriaan why not phi = mod(phi + 360, 360)?
(It is less error prone for me:)
 
@flawr Oh man, I have much to learn. I'll read this instead of using it to prop up my keyboard :p
 
1:45 PM
hehe
but you were close:)
I need to get that book:)
 
I'm actually finishing my B2 German course tomorrow :O On to the real stuff with C1 next semester
 
ooh not bad!
especially considering how your german gets corrupted by the swiss dialects :D
@Adriaan are you gonna have an exam?
 
Well, I did 5 years of German in high school and supposedly had B2 10 years ago :P My girlfriend did just 2 years at school, and now is almost done with C1 and (almost) has an official EDK-anerkend diploma to teach at a German speaking Swiss kantonal school, which she will do starting August :s
@flawr for B2 no, it's a rather informal course from university. For the C1 I plan to, as that makes sense from a CV point of view.
B2 hardly gets you anywhere, especially given I have C2 English already. C1 German, otoh, would be useful.
 
but still, you must have worked quite a lot for that:)
@Adriaan so it is kanti/gymnasium where she is going to teach (like for 16-19 year olds)?
 
Ask my office mates. Especially the Urner might be completely sick of me by now :P I just speak German without cases, as the words and word order are very similar to Dutch. On top of that I pester him with very detailed questions about random tidbits of Swiss politics he's not interested in :P
 
1:51 PM
haha
 
@flawr No, her diploma is for Sec-Schule only. (Sorry, I have no idea what the BL equivalent is). Basically 12-15, before the Kurzgymi
 
ah right
 
Brb, will be gone for ~45 mins
 
well there was an attempt to unify this system, but the cantons couldn't agree, so now only some of them actually joined this effort:)
@Adriaan in many cantons "sekundarschule" is correct
@Adriaan but that is nice, right at that age when the kids start to get (even more) annoying :P
 
Hello everybody!
 
1:55 PM
@Dev-iL hello @Dev-iL
how are you doin?
 
Hwllo
 
The question is not how, but what! And the answer is Mongo+python
so far so yuck
Using too many tools I'm unfamiliar with in one day...
@flawr And you? :)
 
regarding the what, I'm also wrangling snakes:P
currently I'm fighting against exceptions
@Dev-iL new project?
 
@flawr Something like that.... I wrote a crawler for some website, now that the data is downloaded, I figured that the most appropriate way to deal with it was using Mongo... So I managed to filter and reshape it a bit in Mongo, and now I have to perform some finishing processing (probably in pandas) and bring it to MATLAB
 
oh wow, what a crowd
 
2:09 PM
:D
The whole non-MATLAB part is because I didn't want to deal with nesting of depth 6
... which Mongo handles quite casually
 
(I know nothing about mongodb except that is supposedly better than mysql)
How do you access mongo?
 
@flawr It's different, suitable for other types of data
@flawr MATLAB or python or Studio 3T or MongoDB Compass
 
ah I see
 
Can anybody suggest how to perform the following operation in pandas?
 
pandas is a can of worms
looks like the opposite of melt
 
2:19 PM
@AndrasDeak any other python tool would be equally suitable
 
or maybe not...
 
@Dev-iL what happens to bat2?
 
perhaps all those nans mean that I'm completely off the mark
 
@flawr It's the 2nd value encountered, so it's ignored. In truth, I just want either value
 
ah I see
@Dev-iL maybe some groupby magicery?
 
2:23 PM
Perhaps, that's what the SQL action that would do this is called.. I'm just unfamiliar with these operations, so I want to know which is the right one before I start investigating
@AndrasDeak I don't think this is what I need: that Q&A does something similar to a reshape, whereas I want to "merge" rows (split-{apply}-combine) while eliminating missing data
 
OK
anything has already been asked an answered in the pandas tag, one just has to find it
 
@AndrasDeak That's the issue with really big haystacks
 
are your hands tied with the original dataframe? Looks a bit like an XY problem
your requirements might be specific enough that there's no go-to solution
 
@AndrasDeak I don't have to work with a dataframe at all... If I had a pure mongo solution, I would be equally happy... A friend of mine mentioned that it might be simple in pandas
@AndrasDeak Really? I would imagine that this is a fairly common problem
 
What flawr said, groupby, might help. That would allow you iterate the dataframe in groups of the first column, so while doing that you could gather the remaining columns somehow...
@Dev-iL you don't normally have one-hot-like encoding of columns, I'd imagine
way too many holes in that dataframe
that's why I'm a bit suspicious
 
2:32 PM
@AndrasDeak Actually not so much, it's just that the properties of each "object" are split into many rows, so I'm just looking to combine all the information into a single row
 
That's why I'm asking if you can actually do the merge beforehand
if they were dicts "merge dicts with same key" or something would be a straightforward problem
 
@AndrasDeak Possibly, but I don't know how
 
ah yes, with dicts this would make it quite simple in python
 
which suggests that in the worst case one can loop the rows...so some kind of groupby constellation would probably work
 
2:58 PM
@flawr hehe, how typically Swiss. There is something like an education vision 2022 or something (I don't recall the year exactly, the missus does) which does make a great effort into unifying the country into four-languages-one-school-system.
 
3:22 PM
@Adriaan I'm only aware of "harmos"
 
4:06 PM
Doing some serious python is bittersweet. Its all new, so it takes me so much more time to do everything because I do not know it by heart like MATLAB, bad. Also its so elegant and easy to use, good!
 
 
3 hours later…
7:19 PM
In case anybody is interested, here's how I ended up solving it:
    df['_id2'] = df['_id']  # duplicate index
    g = df.groupby('_id2').bfill()  # group & back-fill
    r = g.groupby('_id').head(1).drop(columns=['_id'])  # group & take 1st row
    return r.to_json(orient='records')
 
 
2 hours later…
9:15 PM
@AnderBiguri Evangelizing...
 
that reminds me... :P i.stack.imgur.com/nwedd.jpg
proof of viridis
 
9:43 PM
Hard to see :-)
 
@LuisMendo all hail the proper colomarps!
 
10:04 PM
@AnderBiguri Speaking of properness... you could have done a less lazy job when converting Python syntax to Matlab. Poor editor goes all orange :-P
 
10:44 PM
@AnderBiguri elegant? meh
 
11:38 PM
@LuisMendo hahahah I know, its because of the coma I think, but I copy pasted all and could not be bothered to remove those
@flawr meh only?
 

« first day (1790 days earlier)      last day (1423 days later) »