module3/exo3/Paweena

parent cece2db3
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"pip install arviz" "pip install arviz"
] ]
}, },
...@@ -81,6 +82,7 @@ ...@@ -81,6 +82,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"pip install git+https://github.com/pymc-devs/pymc3" "pip install git+https://github.com/pymc-devs/pymc3"
] ]
}, },
...@@ -108,6 +110,7 @@ ...@@ -108,6 +110,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"pip install bokeh" "pip install bokeh"
] ]
}, },
...@@ -127,6 +130,7 @@ ...@@ -127,6 +130,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"conda create -n py35 python=3.5 anaconda" "conda create -n py35 python=3.5 anaconda"
] ]
}, },
...@@ -146,25 +150,17 @@ ...@@ -146,25 +150,17 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"conda install spyder" "conda install spyder"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 9,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [],
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting package metadata (current_repodata.json): | Killed\n",
"\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
],
"source": [ "source": [
"# Install library/package\n",
"conda install theano" "conda install theano"
] ]
}, },
...@@ -184,6 +180,7 @@ ...@@ -184,6 +180,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"conda install tensorflow" "conda install tensorflow"
] ]
}, },
...@@ -203,6 +200,7 @@ ...@@ -203,6 +200,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"conda install keras" "conda install keras"
] ]
}, },
...@@ -265,6 +263,7 @@ ...@@ -265,6 +263,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"pip install pymc3" "pip install pymc3"
] ]
}, },
...@@ -291,6 +290,7 @@ ...@@ -291,6 +290,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"pip install numpy==1.15.4" "pip install numpy==1.15.4"
] ]
}, },
...@@ -300,6 +300,7 @@ ...@@ -300,6 +300,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# import library\n",
"import numpy as np\n", "import numpy as np\n",
"import pandas as pd\n", "import pandas as pd\n",
"import matplotlib.pyplot as plt" "import matplotlib.pyplot as plt"
...@@ -528,6 +529,7 @@ ...@@ -528,6 +529,7 @@
} }
], ],
"source": [ "source": [
"# read dataset from URL (July 2021)\n",
"data_url = \"https://scrippsco2.ucsd.edu/assets/data/atmospheric/stations/in_situ_co2/monthly/monthly_in_situ_co2_mlo.csv\"\n", "data_url = \"https://scrippsco2.ucsd.edu/assets/data/atmospheric/stations/in_situ_co2/monthly/monthly_in_situ_co2_mlo.csv\"\n",
"data_monthly= pd.read_csv(data_url,skiprows=54)\n", "data_monthly= pd.read_csv(data_url,skiprows=54)\n",
"data_monthly" "data_monthly"
...@@ -756,6 +758,7 @@ ...@@ -756,6 +758,7 @@
} }
], ],
"source": [ "source": [
"# Delete row 1: first two lines : \" \" and “Excel”. These lines seems to be useless.\n",
"data_monthly = data_monthly.iloc[1:]\n", "data_monthly = data_monthly.iloc[1:]\n",
"data_monthly" "data_monthly"
] ]
...@@ -983,6 +986,7 @@ ...@@ -983,6 +986,7 @@
} }
], ],
"source": [ "source": [
"# Delete row 1: first two lines : \" \" and “Excel”. These lines seems to be useless.\n",
"data = data_monthly.iloc[1:]\n", "data = data_monthly.iloc[1:]\n",
"data" "data"
] ]
...@@ -1280,6 +1284,7 @@ ...@@ -1280,6 +1284,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"conda install mkl-service" "conda install mkl-service"
] ]
}, },
...@@ -1299,6 +1304,7 @@ ...@@ -1299,6 +1304,7 @@
} }
], ],
"source": [ "source": [
"# Install library/package\n",
"pip install pymc3==3.11.2" "pip install pymc3==3.11.2"
] ]
}, },
...@@ -1322,6 +1328,8 @@ ...@@ -1322,6 +1328,8 @@
} }
], ],
"source": [ "source": [
"# make plot\n",
"\n",
"import pymc3 as pm\n", "import pymc3 as pm\n",
"import arviz as az\n", "import arviz as az\n",
"import matplotlib.pyplot as plt\n", "import matplotlib.pyplot as plt\n",
...@@ -1489,6 +1497,8 @@ ...@@ -1489,6 +1497,8 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# make plot using ggplot\n",
"\n",
"%matplotlib inline\n", "%matplotlib inline\n",
"from plotnine.data import mpg\n", "from plotnine.data import mpg\n",
"from plotnine import ggplot\n", "from plotnine import ggplot\n",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment