Anpassung an aktuelles Jupyter
parent
186c111835
commit
8d3729b778
|
@ -40,28 +40,9 @@
|
|||
"## Hinweis\n",
|
||||
"\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",
|
||||
"![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']`"
|
||||
"![upload_file.png](upload_file.png)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -235,7 +216,7 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"d = pandas.read_csv(\"file:car.csv\", sep=\"\\t\")\n",
|
||||
"d = pandas.read_csv(\"car.csv\", sep=\"\\t\")\n",
|
||||
"d"
|
||||
]
|
||||
},
|
||||
|
@ -254,7 +235,7 @@
|
|||
"metadata": {},
|
||||
"outputs": [],
|
||||
"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": [],
|
||||
"source": [
|
||||
"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\"]"
|
||||
]
|
||||
},
|
||||
|
|
|
@ -9,6 +9,8 @@ preprocess:
|
|||
html: preprocess
|
||||
jupyter-book build .
|
||||
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:
|
||||
rm -rf _build
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
title: Data Science mit Python
|
||||
author: MARS – Center for Entrepreneurship
|
||||
email: c.giess@hs-mannheim.de
|
||||
copyright: "2022"
|
||||
copyright: "2023"
|
||||
logo: logo_mars.png
|
||||
|
||||
only_build_toc_files: true
|
||||
|
@ -14,9 +14,12 @@ execute:
|
|||
latex:
|
||||
latex_documents:
|
||||
targetname: python_data_science.tex
|
||||
author: Dr. Christoph Giess \\ MARS – Center for Entrepreneurship
|
||||
latex_show_urls: inline
|
||||
latex_show_pagerefs: true
|
||||
|
||||
sphinx:
|
||||
extra_extensions:
|
||||
- sphinx_jupyterbook_latex
|
||||
config:
|
||||
language: German
|
||||
language: de
|
||||
|
|
|
@ -16,7 +16,7 @@ und jetzt lernen möchten, wie man Daten mit Hilfe von Python auswerten kann.
|
|||
|
||||
* Jupyter
|
||||
* https://jupyter.org/try-jupyter/lab/
|
||||
* Notebook Pyolite
|
||||
* Notebook - Python (Pyodide)
|
||||
* Python im Webbrowser
|
||||
* Input-Zeile bedienen
|
||||
* 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