Skip to content

Commit a559476

Browse files
Sketch first exercises day 3 morning
1 parent 60aa467 commit a559476

10 files changed

Lines changed: 123 additions & 12 deletions

File tree

docs/day3/matplotlib/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ Tetralith |`module load buildtool-easybuild/4.8.0-hpce082752a2 GCC/13.2.0 Pytho
2929

3030
<!-- markdownlint-enable MD013 -->
3131

32+
## Exercises
33+
34+
```python
35+
import matplotlib as mpl
36+
import matplotlib.pyplot as plt
37+
38+
x = np.linspace(0, 10, 100)
39+
40+
plt.plot(x, np.sin(x))
41+
plt.plot(x, np.cos(x))
42+
43+
# plt.show()
44+
plt.figure().savefig('my_figure.png') # Unsure if this works
45+
46+
```
3247

3348
## External links
3449

docs/day3/pandas/README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,53 @@ Tetralith |`module load buildtool-easybuild/4.8.0-hpce082752a2 GCC/13.2.0 Pytho
2828

2929
<!-- markdownlint-enable MD013 -->
3030

31+
## Exercises
32+
33+
## Exercise 1: minimal code
34+
35+
Get this code to run:
36+
37+
```python
38+
import pandas
39+
print(pandas.__version__)
40+
```
41+
42+
## Exercise 2
43+
44+
Depends on Matplotlib
45+
46+
Series:
47+
48+
```python
49+
#
50+
data = pd.Series([0.25, 0.5, 0.75, 1.0])
51+
data = pd.Series({2:'a', 1:'b', 3:'c'})
52+
print(data.values)
53+
```
54+
55+
Data frame:
56+
57+
```python
58+
population_dict = {'California': 38332521,
59+
'Texas': 26448193,
60+
'New York': 19651127,
61+
'Florida': 19552860,
62+
'Illinois': 12882135}
63+
population = pd.Series(population_dict)
64+
population
65+
area_dict = {'California': 423967, 'Texas': 695662, 'New York': 141297,
66+
'Florida': 170312, 'Illinois': 149995}
67+
area = pd.Series(area_dict)
68+
area
69+
states = pd.DataFrame({'population': population,
70+
'area': area})
71+
states
72+
```
73+
74+
## Done?
75+
76+
Go to [the session about Matplotlib](../matplotlib/README.md)
77+
3178
## External links
3279

3380
- [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/)

docs/day3/seaborn/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,46 @@ Dardel |`module load cray-python/3.11.7 PDCOLD/23.12 matplotlib/3.8.2-cpeGNU
2929

3030
<!-- markdownlint-enable MD013 -->
3131

32+
## Exercises
33+
34+
```python
35+
import matplotlib.pyplot as plt
36+
plt.style.use('classic')
37+
%matplotlib inline
38+
import numpy as np
39+
import pandas as pd
40+
41+
# Create some data
42+
rng = np.random.RandomState(0)
43+
x = np.linspace(0, 10, 500)
44+
y = np.cumsum(rng.randn(500, 6), 0)
45+
46+
# Plot the data with Matplotlib defaults
47+
plt.plot(x, y)
48+
plt.legend('ABCDEF', ncol=2, loc='upper left');
49+
50+
51+
import seaborn as sns
52+
sns.set()
53+
54+
55+
# same plotting code as above!
56+
plt.plot(x, y)
57+
plt.legend('ABCDEF', ncol=2, loc='upper left');
58+
```
59+
60+
```python
61+
data = np.random.multivariate_normal([0, 0], [[5, 2], [2, 2]], size=2000)
62+
data = pd.DataFrame(data, columns=['x', 'y'])
63+
64+
# Two overlaid density plots
65+
for col in 'xy':
66+
sns.kdeplot(data[col], shade=True)
67+
68+
# Density plot
69+
sns.kdeplot(data);
70+
```
71+
3272
## External links
3373

3474
- [Python Data Science Handbook](https://jakevdp.github.io/PythonDataScienceHandbook/)

evaluations/20250425_day_2/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ From the registration form.
1313

1414
Using cluster |Number of learners
1515
----------------------------------------|------------------
16-
Using NAISS cluster |35
17-
Using local university cluster |13
18-
Previously used NAISS/SNIC |7
19-
Previously used local/university cluster|8
20-
Other clusters |5
21-
Never used clusters |10
22-
16+
Using NAISS cluster |35
17+
Using local university cluster |13
18+
Previously used NAISS/SNIC |7
19+
Previously used local/university cluster|8
20+
Other clusters |5
21+
Never used clusters |10
22+
2323
Using Python |Number of learners
2424
-------------------------------------------------------------------------------------------------|------------------
2525
I have no previous experience with Python |6
2626
I know Python at a beginner level, can write very simple Python code, can import a Python package|25
2727
I have an intermediate knowledge of Python. I can install Python packages |15
2828
I am proficient in Python |16
29-
29+
3030
Using Linux |Number of learners
3131
---------------------------------------------------------------------------------------------------------------------------------------------|-------------------
3232
I have never used Linux/Unix |3

meeting_notes/2022_1_spring.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
UPPMAX and HPC2n is organising a joint workshop on how to run Python and install additional Python packages on the computer resources provided by UPPMAX and HPC2N and how to use the HPC capabilities. Participants will be able to bring their particular software request for discussion as well.
110110

111111
**The following will be covered:**
112+
112113
- Loading the appropriate Python module
113114
- Packages
114115
- checking installed packages

meeting_notes/2022_2_autumn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ Don’t know 25%
132132
5|13.50 | **Leg stretch**
133133
20 | 13.55 |ML intro|+demos
134134
25| 14.15 |UPPMAX session2| Lecture +Ex? | jupyter, Bianca
135-
25| 14.15|HPC2N session2|Lecture + Ex?|ML exercise| User interaction |
135+
25| 14.15|HPC2N session2|Lecture + Ex?|ML exercise| User interaction |
136136
|**15**|14.40 |**Coffee**||
137137
15| 14.55 |Summary| Lecture|Describe when to do what| Keypoints
138138
25| 15.10| Exercises not recorded

meeting_notes/2023_1_spring.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ UPPMAX and HPC2n is organising a joint workshop on how to run Python and install
271271
The instructors will use UPPMAX's systems for demos and there will be hands-on exercises for the participants.
272272

273273
**The following will be covered:**
274+
274275
- Loading the appropriate Python module
275276
- Packages
276277
- checking installed packages

meeting_notes/2023_2_autumn.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
- ToDos: See last meeting
113113

114114
### Meeting 24 Oct 15.15
115+
115116
- Suggestions from Björn
116117
- minimize packages sections
117118
- [x] links and keypoints from October course

meeting_notes/2024_1_spring.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* onboarding 14 May at 1.15-2pm
55

66
## Next meeting May 29 13.00
7+
78
* Evaluation
89
* big data
910
* point to other on-line material for specific science topics
@@ -17,6 +18,7 @@
1718
* not learning the solutions of the problems!
1819

1920
## Next meeting May 8 13:00
21+
2022
* Status
2123
* number: 57?
2224
* Rebecca is contacted for fall python/matlab training
@@ -41,6 +43,7 @@
4143
*
4244

4345
## Next meeting May 2 10:00
46+
4447
* Status
4548
* BC
4649
* just started due to other duties (new web going live tomorrow)
@@ -69,6 +72,7 @@
6972
* Postponed
7073

7174
## Next meeting April 10 13.00
75+
7276
* Short one
7377
* Status
7478
* what is needed?
@@ -124,10 +128,12 @@ Question session (breakout)| X | X | X
124128
Summary| X | X | X
125129

126130
## Meeting 27 March
131+
127132
* HPC Python: May 15th: leave everything the same: Bi + Bj + Pe teach, Ri assists
128133
* with updates of course from earlier learnings
129134
* py/3.11 (GPU UPPMAX perhaps other solution)
130135

131136
### Meeting 15 feb
137+
132138
* ToDos
133139
* [x] UPPMAX web page

meeting_notes/2024_2_autumn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,19 +260,19 @@ Next meeting
260260

261261
- Install package at 10
262262
- Fine!?
263-
- Batch mode:
263+
- Batch mode:
264264
- Perfect!
265265
- Interactive on compute node (be clear en session title)
266266
- Let students try Jupyter in exercise
267267
- more hands-on
268268
- NOTE: Look into Spyder
269269
- Parallel computing
270270
- More hands-on
271-
- GPUs
271+
- GPUs
272272
- Same material but faster?
273273
- Or Extra material?
274274
- exercises
275-
- ML
275+
- ML
276276
- More exercises?
277277
- NOTE: will extend!
278278

0 commit comments

Comments
 (0)