Skip to content

Commit 46f227c

Browse files
committed
Created using Colaboratory
1 parent ea657a0 commit 46f227c

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

jupyter/covid-inf-rate/SantaClara_CmdStanPy.ipynb

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"name": "SantaClara_CmdStanPy.ipynb",
77
"provenance": [],
88
"collapsed_sections": [],
9-
"authorship_tag": "ABX9TyO+4ndiPqTmNPOOEqDioYv+",
9+
"authorship_tag": "ABX9TyN1oagX6vCOD9nEfpF/t/vS",
1010
"include_colab_link": true
1111
},
1212
"kernelspec": {
@@ -512,13 +512,85 @@
512512
"execution_count": 0,
513513
"outputs": []
514514
},
515+
{
516+
"cell_type": "markdown",
517+
"metadata": {
518+
"id": "vGBOK0c4ekFv",
519+
"colab_type": "text"
520+
},
521+
"source": [
522+
"### Play around with the models and data\n",
523+
"\n",
524+
"If you want to play around with your models and data, you can do so using Colab's `file.upload` utility."
525+
]
526+
},
515527
{
516528
"cell_type": "code",
517529
"metadata": {
518530
"id": "nZh7IS4fl8VM",
519531
"colab_type": "code",
520532
"colab": {}
521533
},
534+
"source": [
535+
"from google.colab import files"
536+
],
537+
"execution_count": 0,
538+
"outputs": []
539+
},
540+
{
541+
"cell_type": "markdown",
542+
"metadata": {
543+
"id": "V38jwvTvfbtQ",
544+
"colab_type": "text"
545+
},
546+
"source": [
547+
"The `files.upload()` function allows you to choose files on your machine to upload. It returns a Python dictionary which is a map of filenames to their contents."
548+
]
549+
},
550+
{
551+
"cell_type": "code",
552+
"metadata": {
553+
"id": "QCjxWPoKfVoE",
554+
"colab_type": "code",
555+
"colab": {}
556+
},
557+
"source": [
558+
"uploaded = files.upload()\n",
559+
"uploaded"
560+
],
561+
"execution_count": 0,
562+
"outputs": []
563+
},
564+
{
565+
"cell_type": "markdown",
566+
"metadata": {
567+
"id": "50vnyQN3gObz",
568+
"colab_type": "text"
569+
},
570+
"source": [
571+
"The uploaded files are also saved into the current working directory, so you can refer to them directly by filename. Therefore, once you've uploaded a new Stan program file, you can use this colab notebook to fit your model to the data."
572+
]
573+
},
574+
{
575+
"cell_type": "code",
576+
"metadata": {
577+
"id": "POhsju4ffld2",
578+
"colab_type": "code",
579+
"colab": {}
580+
},
581+
"source": [
582+
"!ls -lt | head -3"
583+
],
584+
"execution_count": 0,
585+
"outputs": []
586+
},
587+
{
588+
"cell_type": "code",
589+
"metadata": {
590+
"id": "w5zVoY_8gTF7",
591+
"colab_type": "code",
592+
"colab": {}
593+
},
522594
"source": [
523595
""
524596
],

0 commit comments

Comments
 (0)