starboard-notebook icon indicating copy to clipboard operation
starboard-notebook copied to clipboard

Js exception with pandas - df[‘a’] / df.a

Open unhott opened this issue 2 years ago • 3 comments

Confirmed the issue on multiple devices/browsers

https://starboard.gg/unhott/Js-exception-pandas-nwAFWup

When trying to index into a dataframe to get a series, js raises this error.

“ TypeError undefined is not an object (evaluating '$.replace')”

unhott avatar Aug 18 '22 17:08 unhott

Actually, the error is slightly different on Firefox 103.0.2

'TypeError $ is undefined'

unhott avatar Aug 18 '22 18:08 unhott

I can confirm the above code works on https://pyodide.org/en/stable/console.html which not only runs code but handles console output which is likely handling the output for df.a.

from pyodide.console import PyodideConsole

It does not appear the Starboard-python handles console output, @gzuidhof may have some thoughts on this.

As a workaround you can convert your output to a string and it will display.

str(df.a)

or

df['a'].to_numpy()

twoxfh avatar Aug 25 '22 12:08 twoxfh

This does look like an error yeah, it seems to be related to Starboard trying to display LaTeX output correctly, other than that I don't currently have the time to debug it :/

gzuidhof avatar Aug 30 '22 10:08 gzuidhof