« first day (3326 days earlier)      last day (197 days later) » 

07:42
Hi all!
@zx8754 it never stops raining here so at least all pollens are blocked on the ground
08:39
@Cath Yeah, same here, rains at least once a week. Helps a lot with pollen.
Hello
 
3 hours later…
11:21
@zx8754 I think every tool has its place. Pipe can be useful sometimes. The problem with the Hadleyverse back then, that they did literally everything with it. I haven't used R for years now, but in Python we string actions with a "." all the time and it is very useful. Think about it, the pipe name comes form the Linux "|" which looks like a pipe- hence, if this is good for hardcore Linux users, it should be good for us, no?
11:43
@DavidArenburg Linux (posix in fact) was based on the idea each tool would do a specific thing, so piping them makes sense on a shell (interactive thing) to give the output from the first to the second and so on. It doesn't mean a language should reproduce it and the comparison with language parsers chaining multiple methods calls on the same object is a bit biased: all theses methods act on the same original object and mutate it.
@Tensibai interesting, haven't thought about it
Though I think piping makes sense in both cases
As long as piping is meant as providing the ouput directly to the input of the next one, that makes sense. My point was more that method chaining isn't really piping as you don't feed the method with the previous output, it's feed with the original object :)
I mean directly as: not needing to allocate memory to store it in a variable
That's my understanding, to be practical I don't find v %>% sum() %>% product() better than product(sum(v)), but maybe some people find it easier to reason about, I find the pipe too verbose for my part.
(and TBH the only reason pipes exists on linux is because most tools are aimed at files, stdout and stdin are files, but separated, so the pipe is here to copy one on the other, you can go cat <file> | grep <whatever> as most people do forgetting you can just go grep <whatever> <file> and avoid launching 2 programs
12:12
yes, in this example doesn't make sense to use pipe. It makes more sense when you work with a data frame and you can't put function into each other, in Python, for example

docs_res = \
docs[sub_cols2].\
sort_values(by = sub_cols2).\
drop_duplicates(subset = sub_cols2).\
reset_index(drop = True).\
rename(columns = dict(zip(sub_cols2, new_cols2))).\
to_dict(orient = "index")
12:31
I still find it absolutely a hell to understand what it makes, and there's so much references to sub_cols2 that I wonder if creating a new var to work on wouldn't make more sense at first. Which kinda prove my point there's no relation with a pipe where you'd just filter for this columns first and then never reference them again.
@Tensibai yes, this is semantics, I agree it could be improved, but how would you do operations by group without pipes for example?
@DavidArenburg You mean in R, python or language agnostic ?
In golang way for some metrics by hypervisors part of a cluster: I start to create a map with cluster as key and an array of values by hypervisors inside, and then I treat each group in // for each cluster.
12:47
In R it is possible (but not so comfortable in base). In Python there is no base, so Pandas or such
you can still use python dicts with pandas
@Tensibai and?
For example, a question like that, you will avoid . at all cost? stackoverflow.com/questions/71209619/…
What I describe above can be a dict by group. Bonus point you can then parallelize each group processing where some pandas methods just loop. (more memory intensive however so your mileage may vary).
But at the end of the day, my main point was: use things when they make sense in maintenance/understandability point of view and if they got complex for performance then comment them so the next one stumbling on it has a clue of the workflow coded under.
I won't avoid any way to write things at all cost, I just weight readability and DRY when using them first, then performance on large objects.
I don't like the way python behave as too often it needs to repeat something multiple times and I feel it doesn't make sense, but that's a personal taste here.
@Tensibai y main point was: use things when they make sense in maintenance/understandability - That was basically my point in my response to Tokhir. Everything has its place
@DavidArenburg Fully agree :) I was pointing method chaining and pipes are not really the same thing in fact, sorry if it did sounds like dismissing the point, that was not the intent
(well, badly worded, I mean what made my add to this was the difference between method chaining and pipes, and I digressed a bit around)
13:10
"Everything has its place" agree. In my case, so far, pipe didn't find its place. Not against it.
Linux, yes pipe all the way. But it is different to R pipes.
 
6 hours later…

« first day (3326 days earlier)      last day (197 days later) »