Skip to content
Snippets Groups Projects
Commit f1b80d1e authored by Tebbo's avatar Tebbo
Browse files

Added Example 18 Monument Table

parent 89f1e8d6
No related branches found
No related tags found
No related merge requests found
Show a Table of all Monuments in Rohlstorf
Data Source: https://opendata.schleswig-holstein.de/dataset/denkmalliste-kreis-segeberg-2025-03-03
%% Cell type:code id: tags:
``` python
from frictionless import describe, Detector, validate, resources
import pandas as pd
from IPython import display
```
%% Cell type:code id: tags:
``` python
# Descibe the data and detect missing values
detector = Detector(field_missing_values=[""])
resource = describe("kreis-segeberg.json", detector=detector)
resource.to_yaml("kreis-segeberg.resource.yaml")
print(resource)
```
%% Output
{'name': 'kreis-segeberg',
'type': 'json',
'path': 'kreis-segeberg.json',
'scheme': 'file',
'format': 'json',
'mediatype': 'text/json',
'encoding': 'utf-8'}
%% Cell type:code id: tags:
``` python
report = validate(resources.TableResource(path="kreis-segeberg.json"))
if not report.valid:
print(report.to_summary())
else:
print("JSON file validated using frictionless.")
# Load as TableResource
source = resources.TableResource("kreis-segeberg.resource.yaml")
# Convert to pandas and remove unwanted columns
df = source.to_pandas()
df = df.drop(columns=["Schutzumfang", "Begründung", "FotoURL", "Beschreibung"])
# Select all monuments in Rohlstorf
df = df[df["Gemeinde"] == "Rohlstorf"]
# Display as table with extra settings for columns width and max number of rows
pd.set_option('max_colwidth', None)
pd.set_option('display.max_rows', None)
display.display(df)
```
%% Output
JSON file validated using frictionless.
This diff is collapsed.
name: kreis-segeberg
type: json
path: kreis-segeberg.json
scheme: file
format: json
mediatype: text/json
encoding: utf-8
18_MonumentTable/output.png

101 KiB

This diff is collapsed.
[project]
name = "18-monumenttable"
version = "0.1.0"
description = ""
authors = [
{name = "Tebbo Beyer"}
]
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"frictionless (>=5.18.0)",
"frictionless[json] (>=5.18.0)",
"pandas (>=2.2.2)",
"ipykernel (>=6.29.5)"
]
[tool.poetry]
package-mode = false
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
...@@ -19,3 +19,4 @@ Example # | Name | Description | Input format | Output | Source ...@@ -19,3 +19,4 @@ Example # | Name | Description | Input format | Output | Source
15 | Police Stations map | Show a map of all police stations in Schleswig-Holstein | CSV | Scatterplot on map | https://opendata.schleswig-holstein.de/dataset/polizeidienststellen-2024-07-30 15 | Police Stations map | Show a map of all police stations in Schleswig-Holstein | CSV | Scatterplot on map | https://opendata.schleswig-holstein.de/dataset/polizeidienststellen-2024-07-30
16 | Bathing Waters map | Show a map of bathing waters in Schleswig-Holstein | CSV | Scatterplot on map | https://opendata.schleswig-holstein.de/dataset/badegewasser-stammdaten-aktuell 16 | Bathing Waters map | Show a map of bathing waters in Schleswig-Holstein | CSV | Scatterplot on map | https://opendata.schleswig-holstein.de/dataset/badegewasser-stammdaten-aktuell
17 | TLS car counting | Show the composition of cars driving over the TLS counting station over the span of the 14.08.2019 in either direction in a stacked area plot | CSV | Stacked area plot | https://opendata.schleswig-holstein.de/dataset/automatische-zahlstelle-kiel-west-2019 17 | TLS car counting | Show the composition of cars driving over the TLS counting station over the span of the 14.08.2019 in either direction in a stacked area plot | CSV | Stacked area plot | https://opendata.schleswig-holstein.de/dataset/automatische-zahlstelle-kiel-west-2019
18 | Monument Table | Show a Table of all Monuments in Rohlstorf | JSON | Table | https://opendata.schleswig-holstein.de/dataset/denkmalliste-kreis-segeberg-2025-03-03
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment