Last active
October 17, 2024 14:21
-
-
Save junkor-1011/cd4fe6fd01e3f0dbf8e38615d97b61a8 to your computer and use it in GitHub Desktop.
Scala(2.13) Jupyter Notebook Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"//> using dep org.plotly-scala::plotly-almond:0.8.5\n", | |
"\n", | |
"import plotly._\n", | |
"import plotly.element._\n", | |
"import plotly.layout._\n", | |
"import plotly.Almond._\n", | |
"\n", | |
"val (x, y) = Seq(\n", | |
" \"Banana\" -> 10,\n", | |
" \"Apple\" -> 8,\n", | |
" \"Grapefruit\" -> 5\n", | |
").unzip" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"Bar(x, y).plot()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Ref:\n", | |
"\n", | |
"- [Scala CLI Doc - Managing dependencies](https://scala-cli.virtuslab.org/docs/guides/introduction/dependencies/)\n", | |
"- [これだけ読めばOK!Scalaの環境構築2023 - Scala-Scriptの実行](https://blog.3qe.us/entry/scala-2023#Scala-Script%E3%81%AE%E5%AE%9F%E8%A1%8C)\n", | |
"- [Zenn - Scala CLIではじめるScala スクリプティング](https://zenn.dev/110416/articles/6db18dda724ec5)" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Scala(2.13)", | |
"language": "scala", | |
"name": "scala2_13" | |
}, | |
"language_info": { | |
"codemirror_mode": "text/x-scala", | |
"file_extension": ".sc", | |
"mimetype": "text/x-scala", | |
"name": "scala", | |
"nbconvert_exporter": "script", | |
"version": "2.13.14" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment