Skip to content

Commit

Permalink
jupyter notebooks for transmogrify samples
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdeepd committed Feb 26, 2019
1 parent 05963bc commit 53e0571
Show file tree
Hide file tree
Showing 9 changed files with 2,474 additions and 0 deletions.
128 changes: 128 additions & 0 deletions helloworld/notebooks/ListOfFiles.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"import java.io.File\n"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import java.io.File"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"getListOfFiles: (dir: String)List[java.io.File]\n"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"def getListOfFiles(dir: String):List[File] = {\n",
" val d = new File(dir)\n",
" if (d.exists && d.isDirectory) {\n",
" d.listFiles.filter(_.isFile).toList\n",
" } else {\n",
" List[File]()\n",
" }\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[/home/beakerx/helloworld/src/main/resources/TitanicDataset/TitanicPassengersTrainData.csv]]"
]
},
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"val files = getListOfFiles(\"/home/beakerx/helloworld/src/main/resources/TitanicDataset\")"
]
},
{
"cell_type": "code",
"execution_count": 9,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[[/home/beakerx/helloworld/src/main/resources/IrisDataset/iris.names, /home/beakerx/helloworld/src/main/resources/IrisDataset/Index.txt, /home/beakerx/helloworld/src/main/resources/IrisDataset/iris.data, /home/beakerx/helloworld/src/main/resources/IrisDataset/bezdekIris.data]]"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"val filesIris = getListOfFiles(\"/home/beakerx/helloworld/src/main/resources/IrisDataset\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Scala",
"language": "scala",
"name": "scala"
},
"language_info": {
"codemirror_mode": "text/x-scala",
"file_extension": ".scala",
"mimetype": "",
"name": "Scala",
"nbconverter_exporter": "",
"version": "2.11.12"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": false,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": false,
"toc_window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading

0 comments on commit 53e0571

Please sign in to comment.