Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Commit

Permalink
feat: add "id" column to Titanic dataset (#29)
Browse files Browse the repository at this point in the history
### Summary of Changes

Names alone were not unique, so I've added an "id" column.
  • Loading branch information
lars-reimann authored Mar 17, 2023
1 parent 53fc7ec commit 34f1389
Show file tree
Hide file tree
Showing 4 changed files with 1,320 additions and 1,314 deletions.
12 changes: 8 additions & 4 deletions docs/examples/titanic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,16 @@
"execution_count": null,
"outputs": [],
"source": [
"from safeds.data.tabular import Table\n",
"from safeds.plotting import correlation_heatmap\n",
"\n",
"titanic_correlation = Table.from_columns(\n",
" titanic.list_columns_with_numerical_values()\n",
")\n",
"titanic_correlation = titanic.keep_columns([\n",
" \"age\",\n",
" \"siblings_spouses\",\n",
" \"parents_children\",\n",
" \"travel_class\",\n",
" \"fare\",\n",
" \"survived\"\n",
"])\n",
"correlation_heatmap(titanic_correlation)"
],
"metadata": {
Expand Down
1 change: 1 addition & 0 deletions src/safeds_examples/tabular/_titanic/_titanic.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def describe_titanic_columns() -> Table:

return Table(
[
{"Name": "id", "Description": "A unique identifier"},
{"Name": "name", "Description": "Name of the passenger"},
{"Name": "sex", "Description": "Sex of the passenger"},
{"Name": "age", "Description": "Age of the passenger at the time of the accident"},
Expand Down
Loading

0 comments on commit 34f1389

Please sign in to comment.