Skip to main content

Data types

When a script runs, Datagrok converts each input parameter to a native value in the target language and converts the script's output back to a Datagrok value. The table below shows the equivalent type used for each Datagrok parameter type, so you can write the script body knowing exactly what you receive and what you must return.

Type correspondence across languages

DatagrokPythonROctaveJuliaJavaScript
intintintegerint64 (cast)Int64number
doublefloatnumericdoubleFloat64number
boolboollogicallogicalBoolboolean
stringstrcharactercharStringstring
datetimedatetime.datetimePOSIXctdatenum (double)Dates.DateTimedayjs instance
dataframepandas.DataFramedata.framecell arrayDataFrames.DataFrameDG.DataFrame
columnstr (column name)character (name)char (name)Symbolstring (name)
column_listlist[str]character vectorcell of stringsVector{Symbol}string[]
list<string>list[str]character vectorcell arrayVector{String}string[]
mapdictnamed liststructDictobject
filepath strpath characterpath charpath StringFileInfo (.data)
blobbytesrawuint8 arrayVector{UInt8}Uint8Array
graphicsmatplotlib.Figurebase plot()any plotPlots.jl + display()DG.Viewer / element

Notes:

  • Python, R, Octave, and Julia scripts run server-side in the Jupyter Kernel Gateway. DataFrames are serialised as CSV (or Parquet when enabled) over HTTP. Graphics outputs are captured from the kernel's display channel (PNG or SVG).
  • JavaScript scripts run in the browser. DG.DataFrame, dayjs, and FileInfo are passed by reference without serialisation. A graphics output is any element or viewer returned by the script.
  • column is passed as the column name, not the column object — look it up inside the script (for example, df[xName] in Python, df[!, xName] in Julia, or df.col(xName) in JavaScript).
  • list requires an explicit element type, currently list<string> only. For numeric or mixed lists, pass a single-column dataframe.

See also