From 16bbb90a466d23a58b18219bfc05a9797bcbf97c Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Wed, 15 Mar 2023 10:41:16 +0100 Subject: [PATCH] docs: create notebook for Titanic dataset --- docs/examples/titanic.ipynb | 99 +++++++++++++++++++++++++++++++++++++ docs/examples/titanic.md | 7 --- mkdocs.yml | 3 +- 3 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 docs/examples/titanic.ipynb delete mode 100644 docs/examples/titanic.md diff --git a/docs/examples/titanic.ipynb b/docs/examples/titanic.ipynb new file mode 100644 index 0000000..c994aec --- /dev/null +++ b/docs/examples/titanic.ipynb @@ -0,0 +1,99 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Titanic\n", + "\n", + "Based on the [\"Titanic\" dataset](https://www.openml.org/search?type=data&sort=runs&id=40945&status=active) by Frank E. Harrell Jr. and Thomas Cason:\n", + "\n", + "> The original Titanic dataset, describing the survival status of individual passengers on the Titanic. The titanic data does not contain information from the crew, but it does contain actual ages of half of the passengers. The principal source for data about Titanic passengers is the Encyclopedia Titanica. The datasets used here were begun by a variety of researchers. One of the original sources is Eaton & Haas (1994) Titanic: Triumph and Tragedy, Patrick Stephens Ltd, which includes a passenger list created by many researchers and edited by Michael A. Findlay.\n", + ">\n", + "> Thomas Cason of UVa has greatly updated and improved the titanic data frame using the Encyclopedia Titanica and created the dataset here. Some duplicate passengers have been dropped, many errors corrected, many missing ages filled in, and new variables created.\n", + "\n", + "## Sample\n" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "from safeds_examples.tabular import load_titanic\n", + "\n", + "titanic = load_titanic()\n", + "titanic.slice(end=10)" + ], + "metadata": { + "collapsed": false, + "pycharm": { + "is_executing": true + } + } + }, + { + "cell_type": "markdown", + "source": [ + "## Schema" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "titanic.schema\n" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "markdown", + "source": [ + "## Statistics" + ], + "metadata": { + "collapsed": false + } + }, + { + "cell_type": "code", + "execution_count": null, + "outputs": [], + "source": [ + "titanic.summary()\n" + ], + "metadata": { + "collapsed": false + } + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 2 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython2", + "version": "2.7.6" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/docs/examples/titanic.md b/docs/examples/titanic.md deleted file mode 100644 index a444e05..0000000 --- a/docs/examples/titanic.md +++ /dev/null @@ -1,7 +0,0 @@ -# Titanic - -Based on the ["Titanic" dataset](https://www.openml.org/search?type=data&sort=runs&id=40945&status=active) by Frank E. Harrell Jr. and Thomas Cason: - -> The original Titanic dataset, describing the survival status of individual passengers on the Titanic. The titanic data does not contain information from the crew, but it does contain actual ages of half of the passengers. The principal source for data about Titanic passengers is the Encyclopedia Titanica. The datasets used here were begun by a variety of researchers. One of the original sources is Eaton & Haas (1994) Titanic: Triumph and Tragedy, Patrick Stephens Ltd, which includes a passenger list created by many researchers and edited by Michael A. Findlay. -> -> Thomas Cason of UVa has greatly updated and improved the titanic data frame using the Encyclopedia Titanica and created the dataset here. Some duplicate passengers have been dropped, many errors corrected, many missing ages filled in, and new variables created. diff --git a/mkdocs.yml b/mkdocs.yml index 36fc2fa..e789cac 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,7 +7,7 @@ nav: - README.md - Changelog: CHANGELOG.md - Examples: - - Titanic: examples/titanic.md + - Titanic: examples/titanic.ipynb - API Reference: reference/ - Development: - Environment: development/environment.md @@ -64,7 +64,6 @@ plugins: include: ["*.ipynb"] execute: true allow_errors: false - include_source: true watch: - src