forked from jorisvandenbossche/DS-python-data-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert_notebooks.sh
executable file
·89 lines (67 loc) · 2.43 KB
/
convert_notebooks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# run this from the the top-level directory
# it creates there a notebooks/ and _solved/solutions/ dir
# that get automatically copied to the correct places
declare -a arr=(
#"00-jupyter_introduction.ipynb"
#"01-basic.ipynb"
#"02-control_flow.ipynb"
#"03-functions.ipynb"
#"04-reusing_code.ipynb"
#"05-numpy.ipynb"
#"python_rehearsal"
"00-jupyter_introduction.ipynb"
"pandas_01_data_structures.ipynb"
"pandas_02_basic_operations.ipynb"
"pandas_03a_selecting_data.ipynb"
"pandas_03b_indexing.ipynb"
"pandas_04_time_series_data.ipynb"
"pandas_05_groupby_operations.ipynb"
"pandas_06_data_cleaning.ipynb"
"pandas_07_missing_values.ipynb"
"pandas_08_reshaping_data.ipynb"
"pandas_09_combining_datasets.ipynb"
"visualization_01_matplotlib.ipynb"
"visualization_02_seaborn.ipynb"
"visualization_03_landscape.ipynb"
"case1_bike_count.ipynb"
"case2_observations.ipynb"
"case3_bacterial_resistance_lab_experiment"
"case4_air_quality_processing.ipynb"
"case4_air_quality_analysis.ipynb"
)
cd _solved
mkdir ./notebooks
echo "- Converting notebooks"
for i in "${arr[@]}"
do
echo "--" "$i"
jupyter nbconvert --to=notebook --config ../nbconvert_config.py --output "notebooks/$i" "$i"
done
echo "- Copying converted notebooks and solutions"
cp -r notebooks/. ../notebooks
cp -r _solutions/. ../notebooks/_solutions
rm -r notebooks/
rm -r _solutions/
cd ..
declare -a arr=(
"00-jupyterlab.ipynb"
"01-variables.ipynb"
"02-functions-use.ipynb"
"03-containers.ipynb"
"04-control-flow.ipynb"
"05-functions-write.ipynb"
)
cd _solved/python_intro
mkdir ./notebooks
echo "- Converting notebooks"
for i in "${arr[@]}"
do
echo "--" "$i"
jupyter nbconvert --to=notebook --config ../../nbconvert_config.py --output "notebooks/$i" "$i"
done
echo "- Copying converted notebooks and solutions"
cp -r notebooks/. ../../notebooks/python_intro
cp -r _solutions/. ../../notebooks/python_intro/_solutions
rm -r notebooks/
rm -r _solutions/
cd ../..