Quickstart - Python
Morph allows you to perform complex data analysis using Python.
To write a Python function, simply add the @morph.func
annotation to a normal Python function and run it in Morph.
About return values
Python return values can be dataframe
, visualisation
, markdown
or json
. Create a value that matches one of these and return it as the return value.
If dataframe
is specified, it will be displayed as is as a Morph dataframe.
If visualisation
is specified, it will be displayed as is as a Morph visualisation. In this case, you can use libraries such as Plotly or Matplotlib to visualise it.
If markdown
is specified, it is displayed as is as a Morph Markdown visualization.
If json
is specified, it will be displayed as Morph’s JSON as is.
About visualisation
For visualisation, implement a function that returns a visualisation object using a library such as Plotly or Matplotlib as follows. Here, take care not to create and return html in the function.
Plotly
Matplotlib