Commit fa2597a2 authored by Bengt Giger's avatar Bengt Giger
Browse files

Added requirements file and documentation

parent 1f8bef4d
Live example: [![Binder](https://binder.let.ethz.ch/badge_logo.svg)](https://binder.let.ethz.ch/v2/git/https%3A%2F%2Fgitlab.ethz.ch%2Fk8s-let%2Fnotebooks%2Fexamples%2Fdata-analysis.git/HEAD?filepath=temperature-anomalies.ipynb)
# Installation of Required Libraries
The execution environment provides a basic set of Python libraries. Libraries like *matplotlib* or *numpy* are often used in Jupyter notebooks, but not part of Python core. To install additional libraries, create a file `requirements.txt` and list your dependencies. See the [pip documentation](https://pip.pypa.io/en/stable/user_guide/) for more information.
\ No newline at end of file
......@@ -19,7 +19,7 @@
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"data = np.genfromtxt('../test_data/data.csv', delimiter=',', dtype=None, skip_header=5, names=('year', 'anomaly'))"
"data = np.genfromtxt('./data.csv', delimiter=',', dtype=None, skip_header=5, names=('year', 'anomaly'))"
]
},
{
......
%% Cell type:markdown id:c90f2d96 tags:
### JupyterNotebook example: Load and plot global temperature anomaly data
Data is available for download at the NOAA (National Oceanic and Atmospheric Administration) National Centers for Environmental Information website https://www.ncdc.noaa.gov/cag/global/time-series
%% Cell type:code id:e33460e5-7bfb-41d4-96d9-1b48a73dd2f8 tags:
``` python
import matplotlib.pyplot as plt
import numpy as np
data = np.genfromtxt('../test_data/data.csv', delimiter=',', dtype=None, skip_header=5, names=('year', 'anomaly'))
data = np.genfromtxt('./data.csv', delimiter=',', dtype=None, skip_header=5, names=('year', 'anomaly'))
```
%% Cell type:code id:e6312b7d-c583-4a16-8d41-bf6a2fc92dd8 tags:
``` python
plt.title('Global Land and Ocean Temperature Anomalies, April-August')
plt.xlabel('year')
plt.ylabel('degrees Celsius +/- from average')
plt.bar(data['year'], data['anomaly'], color='blue')
plt.show()
```
%%%% Output: display_data
%% Cell type:code id:1a46b559 tags:
``` python
```
......
Supports Markdown
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