import $ivy.`ai.kien::python-native-libs:0.1.0`
import ai.kien.python.Python
Python().scalapyProperties.fold(
ex => println(s"Error while getting ScalaPy properties: $ex"),
props => {
props.foreach(Function.tupled(System.setProperty _))
println(props)
}
)
Map(jna.library.path -> /home/kien/.pyenv/versions/miniconda3-latest/lib/python3.7/config-3.7m-x86_64-linux-gnu:/home/kien/.pyenv/versions/miniconda3-latest/lib, scalapy.python.library -> python3.7m)
import $ivy.$ import ai.kien.python.Python
import $ivy.`me.shadaj::scalapy-core:0.5.0`
import me.shadaj.scalapy.py
import me.shadaj.scalapy.py.PyQuote
import me.shadaj.scalapy.py.SeqConverters
import $ivy.$ import me.shadaj.scalapy.py import me.shadaj.scalapy.py.PyQuote import me.shadaj.scalapy.py.SeqConverters
// import $ivy.`sh.almond::almond-scalapy:...`
// automatically pulled in when scalapy ivy import is detected
almond.scalapy.initDisplay
val display = py.module("IPython.core.display")
display: py.Module = <module 'IPython.core.display' from '/home/kien/.pyenv/versions/miniconda3-latest/lib/python3.7/site-packages/IPython/core/display.py'>
val img = display.Image("image.png")
val html = display.HTML(url = "https://google.com")
// If pandas is installed
py.module("pandas").read_csv("https://raw.githubusercontent.com/uiuc-cse/data-fa14/gh-pages/data/iris.csv").head(10)
sepal_length | sepal_width | petal_length | petal_width | species | |
---|---|---|---|---|---|
0 | 5.1 | 3.5 | 1.4 | 0.2 | setosa |
1 | 4.9 | 3.0 | 1.4 | 0.2 | setosa |
2 | 4.7 | 3.2 | 1.3 | 0.2 | setosa |
3 | 4.6 | 3.1 | 1.5 | 0.2 | setosa |
4 | 5.0 | 3.6 | 1.4 | 0.2 | setosa |
5 | 5.4 | 3.9 | 1.7 | 0.4 | setosa |
6 | 4.6 | 3.4 | 1.4 | 0.3 | setosa |
7 | 5.0 | 3.4 | 1.5 | 0.2 | setosa |
8 | 4.4 | 2.9 | 1.4 | 0.2 | setosa |
9 | 4.9 | 3.1 | 1.5 | 0.1 | setosa |
import almond.interpreter.api.DisplayData
import almond.interpreter.api.DisplayData
almond.display.Image.from(new java.io.File("./image.png").toURI.toURL)