News for hackers. Stuff that matters.
Re:Free tools to help with data analysis by ivan_ah on Monday February 25, 2019 @06:00AM (#19244683)
Interesting. Very nice to see live-updating of results like Excel.

Python fails on this transform function:

  def f(a):
      v = a if a >= 4 else 2
      return v
Message in red: "Error: (Brython compile error)"

Update: I recommend you try https://pypyjs.org/ for python in the browser.

Re:Free tools to help with data analysis by davedx on Wednesday February 27, 2019 @08:19AM (#19263026)
I looked into this more. The issue is, at least in a default input, a is an array type, so you need to either access a[0] or map over it. e.g. this works:

  def f(a):
    v = a[0] if a[0] >= 4 else 2
    return v
It looks like the main issue here is getting the correct compile error from Brython. Funnily enough this seems easier to do for the PySpark version :)
Re:Free tools to help with data analysis by davedx on Monday February 25, 2019 @06:08AM (#19244721)
Thanks! I’ll look into it. The reason I chose Brython was because it transpiles in the browser, so no server side compilation needed.