News for hackers. Stuff that matters.
Re:Lets-Plot: An open-source plotting library by JetBrains by gfaure on Saturday July 15, 2023 @11:59PM (#36743484)
I hope with every fibre of my being that this eventually replaces matplotlib and pyplot.
Re:Lets-Plot: An open-source plotting library by JetBrains by Enginerrrd on Sunday July 16, 2023 @12:28AM (#36743646)
I can clearly see they've tried, and perhaps succeeded, in solving some of the frustrations of those tools.

However, what on earth kind of behind the scenes object oriented abstract bastardization have they done wherein you modify the instance of the ggplot class by ADDING stuff to it with a + sign!? Like, when you're trying to toggle one of the flags that would get passed to the class object, why not just do it the way every other class in almost every python library i've ever used does?

I find that horrifying. And I think it is just begging to get some bizarre errors, and I think that

Re:Lets-Plot: An open-source plotting library by JetBrains by data-ottawa on Sunday July 16, 2023 @12:40AM (#36743730)
It’s a port of the R ggplot2 api which works the same way. This wouldn’t be a surprise to most R and statistical computing users.
Re:Lets-Plot: An open-source plotting library by JetBrains by mathisfun123 on Sunday July 16, 2023 @02:56AM (#36744316)

    def __add__(self, other):
      self += other
      return self
    
Simple
Re:Lets-Plot: An open-source plotting library by JetBrains by heywhatupboys on Sunday July 16, 2023 @05:26AM (#36745077)
what is the alternative? python doesn't have a pipe operator

do you want to do

plot(density(colorify(labelaxis(logscale .... )))))))

Re:Lets-Plot: An open-source plotting library by JetBrains by atombender on Sunday July 16, 2023 @07:08AM (#36745629)
Python doesn't have a built-in pipe operator, but that doesn't mean you can't do it. The pipe [1] library is popular.

    is_even = where(lambda x: x % 2 == 0)
    sum(fib() | is_even | take_while(lambda x: x < 4000000)
The Apache Beam SDK for Python is another example. It has its own pipe expressions (|, >>, |>, etc.).

[1] https://github.com/JulienPalard/Pipe

Re:Lets-Plot: An open-source plotting library by JetBrains by heywhatupboys on Sunday July 16, 2023 @11:45AM (#36748295)
I would haver have + than | if we introduce "custom" operators.

Like maybe bitshifting strings into streams wasn't the right syntax, Bjarne

Re:Lets-Plot: An open-source plotting library by JetBrains by ftobin on Tuesday July 18, 2023 @01:14AM (#36768090)
datar effectively recreates a pipe operator and the tidyverse approach.

  df >> mutate(z=f.x)
https://pypi.org/project/datar/