Anpassung an aktuelles Jupyter
parent
186c111835
commit
8d3729b778
|
@ -40,28 +40,9 @@
|
||||||
"## Hinweis\n",
|
"## Hinweis\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Bei den folgenden Beispielen wird die Datei `car.csv` benötigt.\n",
|
"Bei den folgenden Beispielen wird die Datei `car.csv` benötigt.\n",
|
||||||
"Diese findet sich [hier](https://gist.githubusercontent.com/cgiess/58f995bf88cd0e2269b634c7970eb479/raw/2de29b036ead1eabc402301e934b82e8f674aaf4/car.csv). Diese Datei muss auf den Jupyter-Rechner liegen. In der Regel kann man dies mittels `Upload Files` erreichen.\n",
|
"Diese findet sich [in Moodle](https://moodle.hs-mannheim.de/course/view.php?id=4533). Diese Datei muss auf den Jupyter-Rechner liegen. Dazu muss die Datei mittels `Upload Files` hochgeladen werden.\n",
|
||||||
"\n",
|
"\n",
|
||||||
"![upload_file.png](upload_file.png)\n",
|
"![upload_file.png](upload_file.png)\n"
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"Das `Upload Files` funktioniert aber bei https://jupyter.org/try-jupyter/lab/ nicht. Hier muss die Datei wie folgt bereitsgestellt werden (Stand Mai 2022):\n",
|
|
||||||
"\n",
|
|
||||||
"\n",
|
|
||||||
"```\n",
|
|
||||||
"from js import fetch\n",
|
|
||||||
"res = await fetch('https://gist.githubusercontent.com/cgiess/58f995bf88cd0e2269b634c7970eb479/raw/2de29b036ead1eabc402301e934b82e8f674aaf4/car.csv')\n",
|
|
||||||
"text = await res.text()\n",
|
|
||||||
"with open('car.csv', 'w') as f:\n",
|
|
||||||
" f.write(text)\n",
|
|
||||||
"\n",
|
|
||||||
"import os\n",
|
|
||||||
"os.listdir()\n",
|
|
||||||
"```\n",
|
|
||||||
"\n",
|
|
||||||
"Als Ergebnis sollte eine Liste mit Dateienamen angezeigt werden in der `car.csv` enthalten ist, z.B.:\n",
|
|
||||||
"\n",
|
|
||||||
"`['.matplotlib', '.ipython', 'car.csv']`"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -235,7 +216,7 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"d = pandas.read_csv(\"file:car.csv\", sep=\"\\t\")\n",
|
"d = pandas.read_csv(\"car.csv\", sep=\"\\t\")\n",
|
||||||
"d"
|
"d"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -254,7 +235,7 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"d = pandas.read_csv('file:car.csv', sep='\\t', parse_dates=['Datum'])"
|
"d = pandas.read_csv('car.csv', sep='\\t', parse_dates=['Datum'])"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"import pandas\n",
|
"import pandas\n",
|
||||||
"d = pandas.read_csv('file:car.csv', sep='\\t', parse_dates=['Datum'])\n",
|
"d = pandas.read_csv('car.csv', sep='\\t', parse_dates=['Datum'])\n",
|
||||||
"fuel_only = d[d[\"Typ\"] == \"Benzin\"]"
|
"fuel_only = d[d[\"Typ\"] == \"Benzin\"]"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,6 +9,8 @@ preprocess:
|
||||||
html: preprocess
|
html: preprocess
|
||||||
jupyter-book build .
|
jupyter-book build .
|
||||||
pdf: preprocess
|
pdf: preprocess
|
||||||
jupyter-book build --builder pdflatex .
|
jupyter-book build --builder latex .
|
||||||
|
cd _build/latex && sed -i -e 's/letterpaper/a4paper/' -e 's/\(Dr\. Christoph G\)/\\hspace{8.2em}\1/' python_data_science.tex && make && cd ../..
|
||||||
clean:
|
clean:
|
||||||
rm -rf _build
|
rm -rf _build
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
title: Data Science mit Python
|
title: Data Science mit Python
|
||||||
author: MARS – Center for Entrepreneurship
|
author: MARS – Center for Entrepreneurship
|
||||||
email: c.giess@hs-mannheim.de
|
email: c.giess@hs-mannheim.de
|
||||||
copyright: "2022"
|
copyright: "2023"
|
||||||
logo: logo_mars.png
|
logo: logo_mars.png
|
||||||
|
|
||||||
only_build_toc_files: true
|
only_build_toc_files: true
|
||||||
|
@ -14,9 +14,12 @@ execute:
|
||||||
latex:
|
latex:
|
||||||
latex_documents:
|
latex_documents:
|
||||||
targetname: python_data_science.tex
|
targetname: python_data_science.tex
|
||||||
|
author: Dr. Christoph Giess \\ MARS – Center for Entrepreneurship
|
||||||
|
latex_show_urls: inline
|
||||||
|
latex_show_pagerefs: true
|
||||||
|
|
||||||
sphinx:
|
sphinx:
|
||||||
extra_extensions:
|
extra_extensions:
|
||||||
- sphinx_jupyterbook_latex
|
- sphinx_jupyterbook_latex
|
||||||
config:
|
config:
|
||||||
language: German
|
language: de
|
||||||
|
|
|
@ -16,7 +16,7 @@ und jetzt lernen möchten, wie man Daten mit Hilfe von Python auswerten kann.
|
||||||
|
|
||||||
* Jupyter
|
* Jupyter
|
||||||
* https://jupyter.org/try-jupyter/lab/
|
* https://jupyter.org/try-jupyter/lab/
|
||||||
* Notebook Pyolite
|
* Notebook - Python (Pyodide)
|
||||||
* Python im Webbrowser
|
* Python im Webbrowser
|
||||||
* Input-Zeile bedienen
|
* Input-Zeile bedienen
|
||||||
* Python Programm (Code) und Dokumentation ([Markdown](https://de.wikipedia.org/wiki/Markdown))
|
* Python Programm (Code) und Dokumentation ([Markdown](https://de.wikipedia.org/wiki/Markdown))
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 76 KiB |
Binary file not shown.
Loading…
Reference in New Issue