ETL und ELT in Python
Jake Roach
Data Engineer

Die meisten erzeugten und genutzten Daten sind unstrukturierte Daten

API (Application Programming Interface)
$$

JSON (JavaScript Object Notation)
dictionaries{
"key": "value",
...
"open": 0.121875
}
{
"timestamps": [863703000, 863789400, ...],
"open": [0.121875, 0.098438, ...],
"close": [...],
"volume": [...]
}
Verwende die Funktion .read_json()
# Lies eine JSON-Datei im obigen Format ein
raw_stock_data = pd.read_json("raw_stock_data.json", orient="columns")
Daten sind nicht immer direkt DataFrame-tauglich
{
"863703000": {
"volume": 1443120000,
"price": {
"close": 0.09791,
"open": 0.12187
}
},
"863789400": {
...
}, ...
}
import json
with open("raw_stock_data.json", "r") as file:
# Datei in ein Dictionary laden
raw_stock_data = json.load(file)
# Typ der Variable raw_stock_data prüfen
print(type(raw_stock_data))
<class 'dict'>
ETL und ELT in Python