top | item 45772097

(no title)

acdbddh | 4 months ago

In python its common to see code like this:

  df = pd.concat(df,other_df)
  df = df.select(...)
  ...
My eyes hurts, when I see it. It makes me avoid python. I bet the reason for this mutable code is a missing simple pipes syntax. I love pipes. In R can do:

  df |> 
    rbind(other_df) |> 
    select(...)
It feels much better.

discuss

order

leviathan|4 months ago

My eyes would hurt more if I had to look all day at the vertical misalignment of that |> operator

kec|4 months ago

You could always switch to a better font like Fira Code which has a ligature for this.

cubefox|4 months ago

Wouldn't that be simply:

  df = pd.concat(df,other_df).select(...)

fermisea|4 months ago

pandas has a .pipe operator which works exactly like this

zenlot|4 months ago

Nah, it doesn't. Although you can do similar in Elixir.